Fixes to chat and major improvements