Use copy instead of append when generating shared keys.