Added test patterns for Matrix functions. Regenerated all tests patterns to improve testing for tails. Corrected issues in pattern generation scripts.