Ensure uses of ground terms in triggers are preprocessed and registered (#5808)