Ensure spaceless only attempts to replace on string tokens. Fixes gh-336