Adapted to latest API changes.
Latest API updates.