Avoid duplicate connections. (should resolve Bug #1725)