Re-add some changes that got lost in the merge from MC.