anchor.diff:      if (fDemand[OldDemandId].BeingPerformed = 0) and fDemand[OldDemandId].IsDeleted then
         CloseDemand(OldDemandId);
   
  +    UpdateDemandItem(OldDemandId);
  +
       // Delivery should be cancelled now
       CloseDelivery(aDeliveryId);
       aToHouse := nil;
  
positive.code:   Result := 0;
    if aCount = 0 then Exit;
    Assert(aHouse <> nil);
    for I:=1 to fDemandCount do
      if (fDemand[I].Loc_House = aHouse) and (fDemand[I].Ware = aResource) then
        if fDemand[I].BeingPerformed = 0 then
        begin
  
negative.code: 
    if Assigned(fDemand[aID].Item) then
      fDemand[aID].Item.Delete;
  
    fDemand[aID].Item := nil; //Set to nil, as sometimes Item is not nil even after Delete
  end;
  
  
  procedure TKMDeliveries.CloseOffer(aID: Integer);
  begin
    Assert(fOffer[aID].BeingPerformed = 0);
    fOffer[aID].IsDeleted := false;
    fOffer[aID].Ware := wt_None;
    fOffer[aID].Count := 0;
  