Fixed small bugs which caused incorrect messages to be displayed.