fix some bugs in alnse.c