Fixed minor logic bug in motor control.