Fix #to_json issue