Fixed bugs in json due to recent commit (luckily unit tests failed)