Add test and fix some DAO