Few fixes to chat functionality