Fixed type checking when messages are set as unicode.