Fix bugs in lfn_ni.py