Add check to protect against zero length files 2