Adapted to current changes.