Fixed ItemDB bug that caused crashes in InventoryState