Minor improvements in URIUtils

See the commit messages for info about the particular improvement.