Various fixes in the custom string implementation.