Fixed some bugs, and working on message sending