fix the infinite loop in stringIndexOf, fix endsWidth
build