Fixes to testsuite for db cleanup