Backport to AR/AS ~> 3.2 from 4.x