Adapted to removal of activities.