Attempting to fix getStringIndexAt

Adding string length limit.