Cherry picked changes from the 5.34 branch.