Fix Python 3 basestring comparison