Minor refactoring of InventoryBag.