Fixed TypeError and added documentation
Simplified exception message
Merge pull request #1048 from Ayrx/change-unicode-check

Fixed TypeError and added documentation