Fixed a casting problem in Inventory