When trying to run two of the TS examples, I saw an error about matrices in the wrong state. Adding MatSetUp as the error messages suggest prevents the error from being thrown. A patch is attached (or I can push a branch and submit a pull request if that's a better way to deal with a small potential fix like this).