Fixed problem with Python3 and basestring.