Fix bug in reduction