changed parse_int; less code for eof handling