Port remaining test fixes, and fix test_importlib too.