Fixed a bug in reopening tabs