Fix random EventException when listening for InventoryCloseEvent. Made a
check for the InventoryType