bugfixes found while getting groupchat to work, and it mostly is now