Merge "Last command file should be updated after a command finishes" am: 6dfc54cae1 am: 45b7dbea74
am: 567570954e

Change-Id: Icdfa75122de982cd599dbfc1b27f3320ffef2fc8