Fixes in dao and models.