Adapted to latest Core changes.