Fixing issue with leaking database connections.