Fixing bug in which the connection was not being returned to the pool.