Fix tab index when moving a tab