Fix removing database connection.