Copy function fixed.