Sanitize key's for url parameters. Fixes #1816