Handle eilseq and return it as an error
Add tests again