Use copy instead of deepcopy

Deepcopy should not be used (see #7672).