Fix closing of tabs.