Merge cherrypicks of [16816453, 17570067] into sc-d2-release.

Change-Id: Iea54cbabb16aa09e085485ad87d344008ffe5a6f