Fixed a bug that prevented the "inventory" table from being updated
correctly under certain circumstances.