Added an automatic mode toggle.