Fix and test string generation.