Fix setting the initially open tab.

Fixes broken tab behavior when switching tabs for the first time
in each page view.