fix bugs in LMNN