Adapted to latest version.