Improved robustness to the previous tab code