fix bugs in adversary model code