Fixes matrix to matrix conversion.