Fix xml to json conversion bugs