Fixing a bug causing not all the matching terms to be returned
Adding todo