Fix URI tokenisation

Fix half of #1407 (the issue with hyphens in URIs)