diff --git a/Examples/Registration/CMakeLists.txt b/Examples/Registration/CMakeLists.txt
index 9ab1de047abe3e4846d8695b7128559c75911930..95b629005666182b42c776854c92d60dfdb4a5e1 100644
--- a/Examples/Registration/CMakeLists.txt
+++ b/Examples/Registration/CMakeLists.txt
@@ -540,8 +540,8 @@ ADD_TEST(reTeImageRegistration5Cas1ExampleTest ${EXE_TESTS}
 	${INPUTDATA}/QB_Suburb.png
         ${INPUTDATA}/QB_SuburbRotated10.png
 	${TEMP}/ImageRegistration5Output1.png
-	${TEMP}/ImageRegistration5DifferenceAfter1.png
-        ${TEMP}/ImageRegistration5DifferenceBefore1.png
+	${TEMP}/ImageRegistration5DifferenceBefore1.png
+        ${TEMP}/ImageRegistration5DifferenceAfter1.png
 )
 ADD_TEST(reTeImageRegistration5Cas2ExampleTest ${EXE_TESTS}
         --compare-image ${TOL}
@@ -551,8 +551,8 @@ ADD_TEST(reTeImageRegistration5Cas2ExampleTest ${EXE_TESTS}
 	${INPUTDATA}/QB_Suburb.png
         ${INPUTDATA}/QB_SuburbR10X13Y17.png
 	${TEMP}/ImageRegistration5Output2.png
-	${TEMP}/ImageRegistration5DifferenceAfter2.png
-        ${TEMP}/ImageRegistration5DifferenceBefore2.png
+	${TEMP}/ImageRegistration5DifferenceBefore2.png
+        ${TEMP}/ImageRegistration5DifferenceAfter2.png
 )
 
 INCLUDE_DIRECTORIES(${OTB_SOURCE_DIR}/Testing/Code)
diff --git a/Examples/Registration/ImageRegistration5.cxx b/Examples/Registration/ImageRegistration5.cxx
index eed724f2b52884249ef8f00af917cc998c0796f8..3e9b3ce189d142e43e42d51bd3a51110cbc80651 100644
--- a/Examples/Registration/ImageRegistration5.cxx
+++ b/Examples/Registration/ImageRegistration5.cxx
@@ -27,8 +27,8 @@
 //    INPUTS: {QB_Suburb.png}
 //    INPUTS: {QB_SuburbRotated10.png}
 //    OUTPUTS: {ImageRegistration5Output.png}
-//    OUTPUTS: {ImageRegistration5DifferenceAfter.png}
 //    OUTPUTS: {ImageRegistration5DifferenceBefore.png}
+//    OUTPUTS: {ImageRegistration5DifferenceAfter.png}
 //    0.1
 //  Software Guide : EndCommandLineArgs
 
@@ -36,8 +36,8 @@
 //    INPUTS: {QB_Suburb.png}
 //    INPUTS: {QB_SuburbR10X13Y17.png}
 //    OUTPUTS: {ImageRegistration5Output2.png}
-//    OUTPUTS: {ImageRegistration5DifferenceAfter2.png}
 //    OUTPUTS: {ImageRegistration5DifferenceBefore2.png}
+//    OUTPUTS: {ImageRegistration5DifferenceAfter2.png}
 //    1.0
 //  Software Guide : EndCommandLineArgs
 
@@ -620,7 +620,7 @@ int main( int argc, char *argv[] )
     // fixed and moving image after registration.
     if ( argc > 4 )
     {
-      writer2->SetFileName( argv[4] );
+      writer2->SetFileName( argv[5] );
       writer2->Update();
     }
 
@@ -631,7 +631,7 @@ int main( int argc, char *argv[] )
     resample->SetTransform( identityTransform );
     if ( argc > 5 )
     {
-      writer2->SetFileName( argv[5] );
+      writer2->SetFileName( argv[4] );
       writer2->Update();
     }
   }