Fixes longstanding connection bug.
Merge pull request #3645 from SkyMarshal/patch-1

Fixes longstanding connection bug.
Merge remote-tracking branch 'bay12/master'