Fixed some bugs in LFG.