fixing minor bugs in AGREE