Fixed error with contextual tab when no layout is selected