Mtl: more tests, fix bugs that they expose