Fixed bug with automatic mode.