Added a test for the JSON reader, found and fixed a bug in JSON.