Minor simplifications to substring-search code.