Fix token assignment; add test.