Fix bug when "Don't Keep Activities" is enabled