Issue #2220785 by psynaptic: Fixed an undefined offset notice.
Issue #1346946 by psynaptic: Fixed the logic for the blank line at the end of a file check.