Fixed logging of messages