Manually merge in Cl c/342668. Add another test to ensure that it WAI. Change-Id: Iae603328d525cc71e4e31ad30a13384efc50f823