Adapted to Foundation refactoring.