Bug fixes to json mapper