Fix deleteActivities() condition generation