Fix for issue #2

Instead of checking for instances of str, we should check for basestring (common base class of str and unicode string).