Fix loopback address detection