I intentionally kept the changes in this pull request to the minimum required to solve the issue, making sure that code paths other than the one I was specifically changing would not be affected.  While the change to UriBuilder that you suggest seems reasonable, I'd be inclined to handle it as a next step, so that it's clear in the commit logs which changes fix the known issue, and which are refactoring to reduce fragility.