TabBarHelper: Fix a rare bug and compute pressed index, correctly.