fixed glitch in n-gram conversion in LM