Handles scenarios where lines might not end with a newline at the end of the file. Fixes #49.