Fixed various inventory bugs