fixes an incorrect order-of-application of some cherry picks from 1-2 branch.