src: fixed bugs, and added stubs for results of lm