Added more unittest and fixed the bugs found
Added a bunch of tests for testing models