merge of #2623 v1.13.1 test fixes

fixing a bunch of minor issues found in the tests when testing v1.13.1. Notably this ensures that a number of the tests use the driver from the repository, rather than the one installed on the system.
fixing broken compilation on placeholder term
Merge branch 'next' into sam_2156
Made code compile after merge from next, making apply_op be non-const again.

distinct_trans_t needed it to be non-const.
Made some use of FINAL with apply_op and transform_list.