Fix tests by using the updated API