Fixed to_json