Now recognizes EOF and exits program.