Joining segments improved, new test
Joining segments improved, new test