Rework closing of tabs.