Fix logic in finishConnect.