Fix tabs.selectAlternateTab()

This issue is related to revision 664ba3b1df17 and issue 847,
Fixes issue 897