Fix for issue #304
Merge pull request #305 from koeppea/token-fix

Fix for issue #304