anchor.diff:                      AccFBItems::[?RT:key()], AccReqItems::[?RT:key()],
                       SigSize::signature_size(), VSize::signature_size())
           -> {FBItems::[?RT:key()], ReqItems::[?RT:key()], MyIOtherKvTree::gb_tree()}.
  -get_part_diff([], MyIOtherKvTree, FBItems, ReqItems, _SigSize, _VSize) ->
  +get_part_diff(MyEntries, MyIOtherKvTree, FBItems, ReqItems, SigSize, VSize) ->
  +    get_part_diff_(MyEntries, MyIOtherKvTree, FBItems, ReqItems, SigSize,
  +                   util:pow(2, VSize)).
  +
  +%% @doc Helper for get_part_diff/6.
  +-spec get_part_diff_(MyEntries::db_chunk_kv(), MyIOtherKvTree::gb_tree(),
  +                     AccFBItems::[?RT:key()], AccReqItems::[?RT:key()],
  +                     SigSize::signature_size(), VMod::pos_integer())
  +        -> {FBItems::[?RT:key()], ReqItems::[?RT:key()], MyIOtherKvTree::gb_tree()}.
  +get_part_diff_([], MyIOtherKvTree, FBItems, ReqItems, _SigSize, _VMod) ->
       {FBItems, ReqItems, MyIOtherKvTree};
  -get_part_diff([{Key, Version} | Rest], MyIOtherKvTree, FBItems, ReqItems, SigSize, VSize) ->
  -    {KeyBin, VersionShort} = compress_kv_pair(Key, Version, SigSize, VSize),
  +get_part_diff_([{Key, Version} | Rest], MyIOtherKvTree, FBItems, ReqItems, SigSize, VMod) ->
  +    {KeyBin, VersionShort} = compress_kv_pair(Key, Version, SigSize, VMod),
       case gb_trees:lookup(KeyBin, MyIOtherKvTree) of
           none ->
  -            get_part_diff(Rest, MyIOtherKvTree, FBItems, ReqItems,
  -                          SigSize, VSize);
  +            get_part_diff_(Rest, MyIOtherKvTree, FBItems, ReqItems,
  +                           SigSize, VMod);
           {value, OtherVersionShort} ->
               MyIOtherKvTree2 = gb_trees:delete(KeyBin, MyIOtherKvTree),
               if VersionShort > OtherVersionShort ->
  -                   get_part_diff(Rest, MyIOtherKvTree2, [Key | FBItems], ReqItems,
  -                                 SigSize, VSize);
  +                   get_part_diff_(Rest, MyIOtherKvTree2, [Key | FBItems], ReqItems,
  +                                  SigSize, VMod);
                  VersionShort =:= OtherVersionShort ->
  -                   get_part_diff(Rest, MyIOtherKvTree2, FBItems, ReqItems,
  -                                 SigSize, VSize);
  +                   get_part_diff_(Rest, MyIOtherKvTree2, FBItems, ReqItems,
  +                                  SigSize, VMod);
                  true ->
  -                   get_part_diff(Rest, MyIOtherKvTree2, FBItems, [Key | ReqItems],
  -                                 SigSize, VSize)
  +                   get_part_diff_(Rest, MyIOtherKvTree2, FBItems, [Key | ReqItems],
  +                                  SigSize, VMod)
               end
       end.
   
  
positive.code:                     AccFBItems::rr_resolve:kvv_list(), AccReqItems::[?RT:key()],
                      SigSize::signature_size(), VSize::signature_size())
  -> {FBItems::rr_resolve:kvv_list(), ReqItems::[?RT:key()], MyIOtherKvTree::gb_tree()}.
  get_full_diff([], MyIOtherKvTree, FBItems, ReqItems, _SigSize, _VSize) ->
      {FBItems, ReqItems, MyIOtherKvTree};
  get_full_diff([{Key, Version, Value} | Rest], MyIOtherKvTree, FBItems, ReqItems, SigSize, VSize) ->
      {KeyBin, VersionShort} = compress_kv_pair(Key, Version, SigSize, VSize),
      case gb_trees:lookup(KeyBin, MyIOtherKvTree) of
          none ->
              get_full_diff(Rest, MyIOtherKvTree,
                            [{Key, Value, Version} | FBItems], ReqItems,
                            SigSize, VSize);
          {value, OtherVersionShort} ->
              MyIOtherKvTree2 = gb_trees:delete(KeyBin, MyIOtherKvTree),
              if VersionShort > OtherVersionShort ->
                     get_full_diff(Rest, MyIOtherKvTree2,
                                   [{Key, Value, Version} | FBItems], ReqItems,
                                   SigSize, VSize);
                 VersionShort =:= OtherVersionShort ->
                     get_full_diff(Rest, MyIOtherKvTree2, FBItems, ReqItems,
                                   SigSize, VSize);
                 true ->
                     get_full_diff(Rest, MyIOtherKvTree2, FBItems, [Key | ReqItems],
                                   SigSize, VSize)
              end
      end.
  
  
negative.code: 
  %% @doc Transforms a list of key and version tuples (with unique keys), into a
  %%      compact binary representation for transfer.
  -spec compress_kv_list(KVList::db_chunk_kv(), Bin,
                         SigSize::signature_size(), VSize::signature_size())
          -> Bin when is_subtype(Bin, bitstring()).
  compress_kv_list([], Bin, _SigSize, _VSize) ->
      Bin;
  compress_kv_list([{K0, V} | TL], Bin, SigSize, VSize) ->
      KBin = compress_key(K0, SigSize),
      compress_kv_list(TL, <<Bin/bitstring, KBin/bitstring, V:VSize>>, SigSize, VSize).
  
  %% @doc De-compresses the binary from compress_kv_list/4 into a gb_tree with a
  %%      binary key representation and the integer of the (shortened) version.
  