Fixed bug where relative URLs would not be encoded properly if they had query parameters.