Changed to be compatible with API changes.