Fix subtle but important bug in ip_connect(); it shouldn't close the