Fix improper escaping of certain characters in external URIs