Cleanup json_output handling.