Fail nicely on EOF. Fixes #3