Fixed some bugs in the train lexicon output.