Fixed some bugs in DAO test cases