Fix several string related segmentation faults.