Fix unicode messages

There was problem with unicode messages. That is fixed by verifying that incoming variable is basestring (not str) and in case it is not, then we convert variable to unicode (not to str).