Adapted to minor core changes.