Fix numeric mode's reading of standard input

It was crashing when end-of-file was reached.