Add back accidentally reverted getaddrinfo error checking
Fix typo in connect