Avoid some out of bounds reads
fix a bug in number output
Get rid of the cruft leftover from using iterators.
I use const char* now, so I just need to check for '\0' instead of ==end