Fixed all repos to use new sql expressions