Add tests for active menu item
Fix bug found by tests