Fixed some downcasts in InventoryManager and Items