CCL: fix use of "term" field in sub queries