Bugs fix

Fix some bugs in JSON format.