Fix to previous commit

Small fix to the previous commit which missed a couple
WaitForConnection() calls.