Fixed a bug and added tests in lm-composer