since a data structure might contain nil, test for emptiness of input explicitly
Merge pull request #23 from bwo/fix-token

test for emptiness of input explicitly