Patch up tests to remove some global dependencies