Fixed bug in checking for active sidebar.