Fixing use of basestring for Python3 compatability