Fixed some DAO bugs.