Update fix for WSH-related bug: string[i] -> string.charAt(i)