Update last effective tab when number of tabs change

Closes #1120