Avoid searching for empty strings