fixes to NaN handling in json