fixed bug where fromJSON did not raise an error on a trailing comma (e.g. {"a": 1,})