Fixed bug in LogMessage