Correction error when copying matrix