fix a bug in agmgen.cpp