Fix a few bugs with string/text handling.