Fixed some inventory bugs