Merge "Cleanup the activity before the task and stack"