Merge 'maintenance/4.0.x' into main (#2859)