Fixed mock queries to work with conditions