Fix in drawing line algorithm