Fixed a number of bugs in language model code, added tests for smoothed lms