basestring py3 fixes