CDB-2891 connection leaks + bugfix