Modified code for statistic definition creation.