Fixed a bug triggered by indexing deleted activities.