Call onInventoryChanged() within markDirty() to trigger update. Fixes #83.