Ugly code, but should only return results for last term.