The code changes look okay to me, but I'm not sure if we need to rescue getaddress() because it's possible for it to raise an error.  It looks like we never bothered to handle it.