Fixed a bug which broke tab reopen order.