BUGFIX: isinstance(str) -> isinstance(basestring)

Support unicode too.
Merge pull request #649 from jansenm/bugfix-jansenm-1

BUGFIX: isinstance(str) -> isinstance(basestring)