Fixed hanging connection on delete.