Escape forward slashes

This PR prevents an exception being generated when the $key contains a forward slash.