Fix crash when searching multi-byte strings.