Fix typo in calculating string length.