fix for join queries when combined with other search terms; include joins for nonzero check, etc