Fixed error in Dao, implemented more tests