Fixes to make TJSONProtocol work