Added chat functionality and some minor fixes/changes