That's better than the prior patch.  You should squash these two together into a single commit.

Also, I think you can avoid using the toPrivateString() method on URIish when you do that and instead get the password data directly from the URIish.  This reduces the chances that we'll publish the password as part of an error messages when things fail.