Added proper joining of segments when changing path color.