Main functionality now works. Still a number of issues with closing chat windows.