Added graceful error handling for bad input files.