Fix greedy search.