Updated for API changes.