Fixing some connection leaks