FIX: Ensure restoreTabState respects the correct tab ID