Cherry-pick #3103 and #3151 into 2.065 branch

Assigned to: @AndrewEdwards