JSON fixes

as_json to_json who knows.