Removed bugs in chat logging.
Doesn't throw the null exception now.