Fix bug with global reductions