fix for incorrect query building in Repositories.