Fixed waitForConnect.