Updated for new API.