Unit tests
Fix DAO exception when invalid hash
Cleanup