Fixes #2351 : add Inventory support and solve some bugs