When building the query string in PortalURLParser, the URL ends up containing a '?' character, whether there's a query string or not (e.g. http://host/path/?) While not incorrect, it doesn't look very nice.
A similar problem exists for query parameters. The query string always starts with an '&' character. (e.g. http://host/path/?¶m=value)