Fix urlencoding

Fix an issue where certain characters won't get urlencoded correctly