Further deduplicate grammar objects.