Fix some bugs with inventory