Fix connection manager

Targets #580.
nope. re-read the patch!