Fix tests.  Better cleanup of resources.