Cleanup/fix program termination sequence.

Change-Id: I2bc58a2583fb079c9ef383cfc7a5e0fbe613f1cd