Fix for bug in net.connect