Add back optional arg for #to_json method to fix broken tests