[#3697] Backporting 2.3-specific changes