fix for issue #131 : NPE when reaching a terminal node but not at the end of the word
Merge pull request #132 from menny/master

fix for issue #131