Fixed incorrectly handled error check for longchars
Merge pull request #102 from graboy/master

Incorrectly handled error check for widechars