Fixed a small bug in controller schedule logic.