Use backslash for url tests starting with #. Fixes #618

@annevk @smola