Fix some of the queries