Fixed the logic for AND.

Fixed the logic for and. Wasn't anding on just queryied params.