Now properly toggles the various modes.