Handle token parsing correctly

Closes #15