Fixing bug in Distribution::reduce function