Fix bug with query by first_example