fix some LMNN issues