Fixing getStringIndexAt in local copy