Fixed bugs around messages.