Fix chatline/string conversion to remove trailing newlines