Fixed bugs in JSONChat.py.