Fixed small bugs inside genericdao