Fixed some bugs with formatting message.