Fixes #11
merged in fix from master branch
Throw exception when function errors during tokenize