fix bugs in LAOF.cpp