Clean up and fix ConvertMatrixType
Mega write matrix test network