Adjust most of the test to the new API.