Fix bug for multiple pass reduce