Use isinstance() for unicode checking, instead of type() comparison
Merge pull request #226 from ulikoehler/utilimprove

Minor improvements in utils.py