Improve mode switching

More completely disable modes when set inactive.