updates to shortenString, fixes #7630