Fixed a minor bug in JSON handling