Fixing bugs with persistent tab ordering