diff --git a/Imaging/Math/vtkImageMathematics.cxx b/Imaging/Math/vtkImageMathematics.cxx
index bb9537db6fe59a389a30d9dbb50049001d92b43e..2cbf2807ca1c8f85aac672981fe738ae220aa076 100644
--- a/Imaging/Math/vtkImageMathematics.cxx
+++ b/Imaging/Math/vtkImageMathematics.cxx
@@ -65,7 +65,7 @@ void vtkImageMathematics::ReplaceNthInputConnection(int idx, vtkAlgorithmOutput*
 // go on the first port.
 void vtkImageMathematics::SetInputData(int idx, vtkDataObject* input)
 {
-  this->SetInputDataInternal(idx, input);
+  this->AddInputDataInternal(0, input);
 }
 
 //------------------------------------------------------------------------------