Identified and fixed some missing error handling

IMPORTANT: I forgot to mention that in order to get things to test on my
machine, I had to set things up so that the input file is "C:\input.txt"
. This is what I meant by fixing the command line argument earlier and
needs to be addressed. Sorry.