Updated errors and such to handle empty files.