Fixes to make sidebar work more consistently across pages