MultipleCurves: Improve reconnection algorithm