Fixed some queries