Fix bug where command bar would not hide when switching modes