anchor.diff:  	refund(ServiceId, ChargingKey, SessionId, Buckets, []).
   %% @hidden
   refund(ServiceId, ChargingKey, SessionId,
  -		[#bucket{attributes = #{reservations := Reservations}} = H | T], Acc) ->
  +		[#bucket{attributes = Attributes} = H | T], Acc) ->
  +	Reservations = maps:get(reservations, Attributes, #{}),
   	refund(ServiceId, ChargingKey, SessionId,
   			H, maps:to_list(Reservations), T, [], Acc);
   refund(_, _, _, [], Acc) ->
  
positive.code: 		attributes = Attributes} = B | T], Acc, Charged)
  		when Charge > 0, R >= Charge,
  		((Expires == undefined) or (Now < Expires)) ->
  	#{reservations := Reservations} = Attributes,
  	NewReservations = Reservations#{SessionId => #{ts => Now, debit => Charge,
  			reserve => 0, service_id => ServiceId, charging_key => ChargingKey}},
  	NewBuckets = [B#bucket{remain_amount = R - Charge,
  
negative.code: 		[#bucket{units = Type, remain_amount = Remain,
  		attributes = Attributes} = B | T], Acc, Charged, Reserved)
  		when ((Charge > Charged) or (Reserve > Reserved)), Remain > 0 ->
  	Reservations = maps:get(reservations, Attributes, #{}),
  	NewCharge = Charge - Charged,
  	NewReserve = Reserve - Reserved,
  	F = fun({SessionId1, #{service_id := ServiceId1,
  