fix some bugs in alnpe.c