Workarounds for a couple crashes. (Bug 5612584, Bug 5613438)

Change-Id: I9669d830a10cc98291737f3f1d561c846c408289
7 files changed