Changed the merge function so that groups of grounded policies are abstracted with respect to the group and not all grounded policies.