Adapted to core changes.