Update to new API, related to #1304
Update to new API, related to #1304