Adapted to the latest library changes.