Bug: sending the wrong matrix for permutation