Fixed unit test setup to remove shutdown failures