fixed some bugs in DAO implementation
Merge pull request #1 from agpopikov/master

fixed some bugs in DAO implementation