Fix incorrect search behavior