Fix many small bugs and a severe bug (AR model works)
Fix bugs in lm_stat