cherrypicks fc691cb3ba6c1a49b1b71f1169097bee0292f3cc, 679d48ee2b4f08b34481a1c59208421621bf60d1, 167991ecebe30847f76c028bd501f49968271069, 9fb98b83bfd1751c8b71f5ca3b0c977ebc7756e5, 76b2006612a597c555c7384c02373637bd6782d1, 6142c814bf991b829ccb8818050d0cac8ffb9d9e, 58522e5b5ea72896c2893c00bd4cf2939b30a492 from cc branch