Fix a missing optimization in constreduce