More refactoring/fixes in the testsuite