minor bugs in tests and models fixed