anchor.diff:  			update_session(Type, Charge - Amount, Reserve, Now,
   					SessionId, T, NewAcc, Charge, Reserved);
   		{value, {_, Amount, _}, NewReservations}
  -				when (Remain + Amount) =< Charge,
  +				when Remain > 0, (Remain + Amount) =< Charge,
   				((Expires == undefined) or (Now < Expires)) ->
   			NewAcc = [B#bucket{remain_amount = 0, reservations = NewReservations} | Acc],
   			update_session(Type, Charge - (Remain + Amount), Reserve,
  
positive.code: 			reservations = [NewReservation | Reservations]} | T],
  	{Reserved + Amount, NewBuckets};
  reserve_session(Type, Amount, Now, SessionId,
  		[#bucket{remain_amount = 0} = B | T], Acc, Reserved) ->
  	reserve_session(Type, Amount, Now, SessionId, T, [B | Acc], Reserved);
  reserve_session(Type, Amount, Now, SessionId,
  		[#bucket{units = Type, remain_amount = Remain,
  		reservations = Reservations, termination_date = Expires} = B | T],
  		Acc, Reserved) when Remain < Amount,
  		((Expires == undefined) or (Now < Expires)) ->
  	NewReserve = Amount - Remain,
  	NewReservation = {Now, NewReserve, SessionId},
  
negative.code: 			NewAcc = [B#bucket{reservations = NewReservations} | Acc],
  			charge_session(Type, Charged + Charge, Now, SessionId, T, Charge - Amount, NewAcc);
  		{value, {_, Amount, _}, []}
  				when Amount < Charge, Remain > 0, Remain =< (Charge - Amount),
  				((Expires == undefined) or (Now < Expires)) ->
  			charge_session(Type, Charge - Amount - Remain, Now, SessionId, T, Amount + Remain, Acc);
  		{value, {_, Amount, _}, NewReservations}
  				when Amount < Charge, Remain > 0, Remain =< (Charge - Amount),
  				((Expires == undefined) or (Now < Expires)) ->
  			NewAcc = [B#bucket{reservations = NewReservations} | Acc],
  			charge_session(Type, Charge - Amount - Remain, Now, SessionId, T, Amount + Remain, NewAcc);
  