fixed some issues revealed by test1 and test2 in inst/tests (all functions should deal with 1 variable models)
more tests in inst/tests, revealed more issues, fixed