Fix to Stitching algorithms to process groups better.