New version
Fixed bug when lm() fails