[trunk] Rework r2731 since it breaks non-regression testing