Fixed a bug that caused the program to hang when an invalid input filename was provided.