Correct some mistakes.

Add security by testing result of (level & Tools.MessageLogLevel) === Tools.MessageLogLevel.