Use hand-rolled deepcopy instead of system one.