Change order of deletes to satisfy constraints