Strict tokens

Fixes #1196.