anchor.diff:      PosInByte = Pos rem 8,
       PreBitsNum = Pos - PosInByte,
       AccPosBF = (2#10000000 bsr PosInByte),
  -    p_add_list_v2_(Rest, AccPosBF, <<0:PreBitsNum>>, BF).
  -
  -p_add_list_v2_([Pos | Rest], AccPosBF, AccBF, BF) when Pos - erlang:bit_size(AccBF) < 8 ->
  +    p_add_list_v2_(Rest, AccPosBF, <<0:PreBitsNum>>, BF, BFSize).
  +
  +p_add_list_v2_([Pos | Rest], AccPosBF, AccBF, BF, BFSize) when Pos - erlang:bit_size(AccBF) < 8 ->
       % Pos in same byte
       PosInByte = Pos rem 8,
       AccPosBF2 = AccPosBF bor (2#10000000 bsr PosInByte),
  -    p_add_list_v2_(Rest, AccPosBF2, AccBF, BF);
  -p_add_list_v2_([Pos | Rest], AccPosBF, AccBF, BF) ->
  +    p_add_list_v2_(Rest, AccPosBF2, AccBF, BF, BFSize);
  +p_add_list_v2_([Pos | Rest], AccPosBF, AccBF, BF, BFSize) ->
       PosInByte = Pos rem 8,
       PreBitsNum2 = Pos - PosInByte,
       DiffBits = PreBitsNum2 - erlang:bit_size(AccBF) - 8,
  
positive.code: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  -spec get_property(bloom_filter(), atom()) -> not_found | term().
  get_property(#bloom{ size = Size, hfs = Hfs, items_count = NumItems }, fpr) ->
      calc_FPR(Size, NumItems, ?REP_HFS:size(Hfs));
  get_property(Bloom, Property) ->
      FieldNames = record_info(fields, bloom),
  
negative.code:     AccBF2 = <<AccBF/binary, AccPosBF:8, 0:DiffBits>>,
      % make new AccPosBF
      AccPosBF2 = (2#10000000 bsr PosInByte),
      p_add_list_v2_(Rest, AccPosBF2, AccBF2, BF, BFSize);
  p_add_list_v2_([], AccPosBF, AccBF, BF, BFSize) ->
      RestBits = BFSize - erlang:bit_size(AccBF) - 8,
      case BF of
          <<>> -> <<AccBF/binary, AccPosBF:8, 0:RestBits>>;
          _ ->
              <<AccBF2Nr:BFSize>> = <<AccBF/binary, AccPosBF:8, 0:RestBits>>,
              % merge AccBF2 and BF
              <<BFNr:BFSize>> = BF,
              ResultNr = AccBF2Nr bor BFNr,
              <<ResultNr:BFSize>>
      end.
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  % @doc returns true if the bloom filter contains item
  -spec is_element(bloom_filter(), key()) -> boolean().
  is_element(#bloom{filter = <<>>}, _Item) ->
      false;
  is_element(#bloom{size = BFSize, hfs = Hfs, filter = Filter}, Item) -> 
      Positions = ?REP_HFS:apply_val_rem(Hfs, Item, BFSize),
      check_Bits(Filter, Positions).
  