Fixed bugs and refactored messages.