Disallow mat view on a sub-query. Unit test fixes