fix for incorrect query building in Repositories.
Merge pull request #691 from molchanoviv/master

fix for incorrect query building in Repositories.