Bug fix for advance inventory.

issue #578