Add support for newline at end of file

fixes #3