Don't test for unicode.
Fix basestring for Python3 compatibility.