anchor.diff:    end;
   
   var
  -  K,M: Integer;
  +  I,K,M: Integer;
     VertexTKinds: TKMTerrainKindsArray;
     SameTKind, NoCustomTK: Boolean;
  -  TKCounts: array[0..3] of Integer;
  -  MostTKI, vrxCnt: Integer;
  +  TKCounts, MostTKIs: array[0..3] of Integer;
  +  MostTKCnt, MostTKI, vrxCnt: Integer;
   begin
     Result := False;
     aEffectiveTKind := tkCustom;
  
positive.code:         Inc(TKCounts[K]);
  
    //Get Most popular one index
    MostTKI := 0;
    for K := 1 to vrxCnt - 1 do
      if TKCounts[K] > TKCounts[MostTKI] then
        MostTKI := K;
  
    NoCustomTK := VertexTKinds[0] <> tkCustom;
    for K := 1 to vrxCnt - 1 do
  
negative.code:   Assert(vrxCnt > 0, 'Can''t find vertex corners');
  
    for K := 0 to vrxCnt - 1 do
    begin
      TKCounts[K] := 0;
      MostTKIs[K] := 0;
    end;
  
    //Find most popular TerKind
    //Count all TerKinds occurrences first
  