Fix UriComponents.toURI, see @gerdriesselmann comments in #596