Preserve valid JSON output.