fix bug with EOF after value, improve error handling
4 files changed