Various connection bugs fixed.