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: update_session(Type, Charge, Reserve, Now, ServiceId, ChargingKey, SessionId,
  		[#bucket{units = Type, remain_amount = Remain,
  		attributes = Attributes} = B | T], Acc, Charged, Reserved) ->
  	#{reservations := Reservations} = Attributes,
  	NewCharge = Charge - Charged,
  	NewReserve = Reserve - Reserved,
  	F = fun({SessionId1, #{service_id := ServiceId1,
  
negative.code: 		[#bucket{remain_amount = R, end_date = Expires,
  		attributes = Attributes} = B1 | T], UnitsBuckets, Acc)
  		when Price1 > 0, R > 0, ((Expires == undefined) or (Now < Expires)) ->
  	Reservations1 = maps:get(reservations, Attributes, #{}),
  	F = fun({SessionId1, #{service_id := ServiceId1, charging_key := ChargingKey1}})
  					when ServiceId1 =:= ServiceId,
  					ChargingKey1 =:= ChargingKey, SessionId1 == SessionId ->
  