Add another test for basicmodel and fixed some minor bugs