Fixed EOFException

Fixes #25