Whitespace trimming.
Fixing inconsistent connection error handling when multiple targets are given by 'socket.getaddrinfo' function.