Partial fix for #13761.

I know those assignments are currently redundant. But if we modify/refactor this function and the code flow would be changed, copied = 1 might be required again. In my thought those redundant lines are necessary for the code robustness.