Cherry-pick 1595ed67f103686a7f7842cd7e467fadd891f76f