Fix a bug (in exit search algorithm)