Unit tests and fixes for curve_knot_refine