Added a matrix copy routine, which is now used in the matrix product routine in the awful edge case