fix test cleanup

as discussed on mailing list.