Fixing up more of the resource management and also walking through some of the test case changes