fixing a bug where AGREE does not reverse feature groups correctly