Switch stats to ref counting.