Tab selection bugfix