Fixed a bug where the system could crash when expanding am: 3e77984434
am: c19b510454

Change-Id: I9a08497e8c49fe916f42cac3a1d56ea5ec4fc8c3