Changed ordering of template paramters for reduce.