Fixes to output_json