Fix compatibility with API change