Fix for search algorithm.