Motor direction correction