Fix connection leaks