Fix to_json.