Fixed a bug where the last line contains EOF

Last entry in test1.txt has to be commented out to see a successful run.