A better attempt at ensuring test cleanup.