Fixing a bug in the accumulation of expected values when generating sample data for tests