Minor fixes when the application gets killed!

Change-Id: I8da133bd84cf7159d66d18841ae93d3b5188b01d