Rework of merge 2.4 to master PR

Trying to fix stitching test on pull request #2949