Stitching algorithm update to process groups correctly.