More unit tests for json.
Fixed remaining  known bug.