Fix some issues with json conversion