Try to fix connection cleanup and tests