Multiple bug fixes + chat2.js logging for debug