Fix making multiple loops with the same path.
Fix a bug in segment end angle mirroring.

A segment when mirrored would not reflect its start and end angles,
which could result in attempting impossible angles while fusing
segments.