Fix bugs introduced for the new tab behavior