Cleaned up Inventory code.