Fix bug where a string is shorter than expected.