Merge "Backport upstream r1246."