Code refactoring.
Fixed bug in Inventory tab.

This bug prevented the item name textbox from being cleared after an
item was added to the inventory.