Fixes to URL encoding