fixed a case where a variable was being used before initialized if an error occurred, also added support for processing a single file