fixing up typos and a few bugs with process_object when converting to json