Merge "Harden against invalid paths." into pi-dev am: b9596e5feb
am: daea01b53e

Change-Id: I9ddd7d141b0489b50997a6e20f5c463df5677780