Fix overrestrictive type check for unicode v. basestring.