Fix term handling with xfiltered queries

This fixes it when specifying a type.

Change-Id: Icf23aa9394415cad686eab88c52c85bd0274c425