Resolved potential memory issue when swapcasing strings.