Fixes bugs in tokens