Make tests more resilient (they should not fail with memcheck any more).