Fixed errors in DAO