Fixed bug in message output