Fix a few potential crashes

Change-Id: Ib7bdfc1d5fff928570e4fec3f3d4e175f9656dd3
2 files changed