If the amount is memoized, it needs to be updated when an entry is removed.  (Possibly related to your TODO comment on getAmount).