Fixes bug where EOF exception crashes JSON input