fixes to json serialization