Fixes a bug when notebook tabs are overflowed.