Attempt at fixing the to_json issue.