Fix a tag bug when seting a tag to a message.