Bugfix from Hyejin Kim (count=1 shouldn't change name), plus a bounds check.

Test is 'echo "AAA c 1 0 0 2 5 0 0 1" | makedevs' makes AAA not AAA0.
1 file changed