Fixed some bugs with messages