Early exit on EOF (fixes #21)
Merge pull request #22 from spyysalo/master

Fix for #21 (extra newline on EOF)