Improve handling of strings longer than 64KB.