Fix curve length calculation.