Fixed format issues when converting to json.