Add check for uninitalized token to fix #150
Merge pull request #152 from ircmaxell/issue_150_fix

A fix for issue 150