fixes to JSON infrastructure