fix test regressions caused by to_json