Avoid dividing with zero while splitting curves