diff --git a/Device/Detector/FlatDetector.cpp b/Device/Detector/FlatDetector.cpp
index 4437bf30d5e94239b4049cefebe84a17d080722b..2196ad7df880dad795e97f642dd41a862911188a 100644
--- a/Device/Detector/FlatDetector.cpp
+++ b/Device/Detector/FlatDetector.cpp
@@ -27,8 +27,8 @@ using std::numbers::pi;
 
 FlatDetector::FlatDetector(size_t nxbins, size_t nybins, double width, double height,
                            const Beam& beam, NominalNormal nominalNormal, double distance,
-                           double pitch, double yaw, double roll, double offcenter_w,
-                           double offcenter_h)
+                           double offcenter_w, double offcenter_h, double pitch, double yaw,
+                           double roll)
     : IDetector(Frame{newEquiDivision("u (mm)", nxbins, 0.0, width),
                       newEquiDivision("v (mm)", nybins, 0.0, height)})
     , m_nominalNormal(nominalNormal)
diff --git a/Device/Detector/FlatDetector.h b/Device/Detector/FlatDetector.h
index 7a9dd5e7fd9ca1113b6ffdf128f1b774f3641178..7b37026df4b6cc37131e16c157ac044f226226f4 100644
--- a/Device/Detector/FlatDetector.h
+++ b/Device/Detector/FlatDetector.h
@@ -28,8 +28,8 @@ public:
     enum NominalNormal { X, T, R };
 
     FlatDetector(size_t nxbins, size_t nybins, double width, double height, const Beam& beam,
-                 NominalNormal nominalNormal, double distance, double pitch = 0, double yaw = 0,
-                 double roll = 0, double offcenter_w = 0, double offcenter_h = 0);
+                 NominalNormal nominalNormal, double distance, double offcenter_w = 0,
+                 double offcenter_h = 0, double pitch = 0, double yaw = 0, double roll = 0);
 
     FlatDetector(const FlatDetector& other);
     ~FlatDetector() override;
diff --git a/GUI/Model/Detector/FlatDetectorItem.cpp b/GUI/Model/Detector/FlatDetectorItem.cpp
index efc6e6ae91bf4b67d85d79f56403a7e169fa79c5..1a31b75cb545d9c9df78a523c81be969ea84b6a6 100644
--- a/GUI/Model/Detector/FlatDetectorItem.cpp
+++ b/GUI/Model/Detector/FlatDetectorItem.cpp
@@ -255,8 +255,8 @@ FlatDetector::NominalNormal FlatDetectorItem::detectorAlignment() const
 std::unique_ptr<IDetector> FlatDetectorItem::createDomainDetector(const Beam& beam) const
 {
     return std::make_unique<FlatDetector>(xSize(), ySize(), width(), height(), beam,
-                                          detectorAlignment(), m_distance, 0, 0, 0,
-                                          m_u0 - width() / 2, m_v0 - height() / 2);
+                                          detectorAlignment(), m_distance, m_u0 - width() / 2,
+                                          m_v0 - height() / 2, 0, 0, 0);
 }
 
 void FlatDetectorItem::updateTooltips()
diff --git a/Sim/Export/SimulationToPython.cpp b/Sim/Export/SimulationToPython.cpp
index 47e8d5e69b9fa1f7834c080995044cd70cfc5711..8cc797e61450a17828c215b63172f6692921d582 100644
--- a/Sim/Export/SimulationToPython.cpp
+++ b/Sim/Export/SimulationToPython.cpp
@@ -151,9 +151,9 @@ std::string defineDetector(const IDetector& detector)
         result << indent() << "detector = ba.FlatDetector(" << det->xSize() << ", " << det->ySize()
                << ", " << Py::Fmt::printDouble(det->width()) << ", "
                << Py::Fmt::printDouble(det->height()) << ", beam, ba.FlatDetector."
-               << det->normalName() << ", " << Py::Fmt::printDouble(det->getDistance()) << ", " << 0
-               << ", " << 0 << ", " << 0 << ", " << det->getU0() - det->width() / 2 << ", "
-               << det->getV0() - det->height() / 2 << ")\n";
+               << det->normalName() << ", " << Py::Fmt::printDouble(det->getDistance()) << ", "
+               << det->getU0() - det->width() / 2 << ", " << det->getV0() - det->height() / 2
+               << ", " << 0 << ", " << 0 << ", " << 0 << ")\n";
     } else
         ASSERT_NEVER; // unknown detector
     if (detector.hasExplicitRegionOfInterest()) {
diff --git a/Tests/SimFactory/MakeSimulations.cpp b/Tests/SimFactory/MakeSimulations.cpp
index e3ce012b31e74e27c777f3711666fbab6d446dba..2708d74c6dcb3bcf554325304a4a168a4185b8b2 100644
--- a/Tests/SimFactory/MakeSimulations.cpp
+++ b/Tests/SimFactory/MakeSimulations.cpp
@@ -212,7 +212,7 @@ std::unique_ptr<ScatteringSimulation> test::makeSimulation::MaxiGISAS00(const Mu
 std::unique_ptr<ScatteringSimulation>
 test::makeSimulation::RectDetectorPerpToSample(const MultiLayer& sample)
 {
-    FlatDetector detector(40, 30, 20., 18., stdBeam, FlatDetector::X, 1000, 0, 0, 0, 0, -8);
+    FlatDetector detector(40, 30, 20., 18., stdBeam, FlatDetector::X, 1000, 0, -8, 0, 0, 0);
     return std::make_unique<ScatteringSimulation>(stdBeam, sample, detector);
 }
 
@@ -221,7 +221,7 @@ test::makeSimulation::RectDetectorPerpToSample(const MultiLayer& sample)
 std::unique_ptr<ScatteringSimulation>
 test::makeSimulation::RectDetectorPerpToDirectBeam(const MultiLayer& sample)
 {
-    FlatDetector detector(40, 30, 20., 18., stdBeam, FlatDetector::T, 1000, 0, 0, 0, 0, -8);
+    FlatDetector detector(40, 30, 20., 18., stdBeam, FlatDetector::T, 1000, 0, -8, 0, 0, 0);
     return std::make_unique<ScatteringSimulation>(stdBeam, sample, detector);
 }
 
@@ -230,7 +230,7 @@ test::makeSimulation::RectDetectorPerpToDirectBeam(const MultiLayer& sample)
 std::unique_ptr<ScatteringSimulation>
 test::makeSimulation::RectDetectorPerpToReflectedBeam(const MultiLayer& sample)
 {
-    FlatDetector detector(40, 30, 20., 18., stdBeam, FlatDetector::R, 1000, 0, 0, 0, 0, -8);
+    FlatDetector detector(40, 30, 20., 18., stdBeam, FlatDetector::R, 1000, 0, -8, 0, 0, 0);
     return std::make_unique<ScatteringSimulation>(stdBeam, sample, detector);
 }
 
@@ -260,7 +260,7 @@ test::makeSimulation::SphericalDetWithRoi(const MultiLayer& sample)
 
 std::unique_ptr<ScatteringSimulation> test::makeSimulation::RectDetWithRoi(const MultiLayer& sample)
 {
-    FlatDetector detector(40, 30, 20., 18., stdBeam, FlatDetector::T, 1000, 0, 0, 0, 0, -8);
+    FlatDetector detector(40, 30, 20., 18., stdBeam, FlatDetector::T, 1000, 0, -8, 0, 0, 0);
     detector.addMask(Rectangle(3.0, 4.0, 5.0, 7.0));
     detector.setRegionOfInterest(2.01, 3.01, 17.99, 14.99);
     return std::make_unique<ScatteringSimulation>(stdBeam, sample, detector);
diff --git a/auto/Examples/fit/scatter2d/expfit_galaxi.py b/auto/Examples/fit/scatter2d/expfit_galaxi.py
index b4c5a32a4afbf28bf62982e4ef298312927e0c06..3979a2567979322c6c229dbcc7381bfc748a4697 100755
--- a/auto/Examples/fit/scatter2d/expfit_galaxi.py
+++ b/auto/Examples/fit/scatter2d/expfit_galaxi.py
@@ -97,13 +97,13 @@ def create_detector(beam):
     nx = pilatus_npx
     ny = pilatus_npy
     s = pilatus_pixel_size
-    wx = nx*s 
+    wx = nx*s
     wy = ny*s
     u0 = beam_xpos*s  # in mm
     v0 = beam_ypos*s  # in mm
     return ba.FlatDetector(
         nx, ny, wx, wy, beam, ba.FlatDetector.T, detector_distance,
-        0, 0, 0, u0 - wx/2, v0 - wy/2)
+        u0 - wx/2, v0 - wy/2, 0, 0, 0)
 
 
 def create_simulation(P):
diff --git a/auto/MiniExamples/fit/scatter2d/expfit_galaxi.py b/auto/MiniExamples/fit/scatter2d/expfit_galaxi.py
index e12d087873fbeee7e6c94d671f10e2822394e0ce..55dad7f3945af53ccae920943d7f4c374c6c3a4e 100755
--- a/auto/MiniExamples/fit/scatter2d/expfit_galaxi.py
+++ b/auto/MiniExamples/fit/scatter2d/expfit_galaxi.py
@@ -97,13 +97,13 @@ def create_detector(beam):
     nx = pilatus_npx
     ny = pilatus_npy
     s = pilatus_pixel_size
-    wx = nx*s 
+    wx = nx*s
     wy = ny*s
     u0 = beam_xpos*s  # in mm
     v0 = beam_ypos*s  # in mm
     return ba.FlatDetector(
         nx, ny, wx, wy, beam, ba.FlatDetector.T, detector_distance,
-        0, 0, 0, u0 - wx/2, v0 - wy/2)
+        u0 - wx/2, v0 - wy/2, 0, 0, 0)
 
 
 def create_simulation(P):
diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py
index 2869c7ef8c3d8924d2a5b589efbbd9e54fefb26d..105be30ba8705f244dd52afe49be6dcf5f539c41 100644
--- a/auto/Wrap/libBornAgainDevice.py
+++ b/auto/Wrap/libBornAgainDevice.py
@@ -2790,7 +2790,7 @@ class FlatDetector(IDetector):
 
     def __init__(self, *args):
         r"""
-        __init__(FlatDetector self, size_t nxbins, size_t nybins, double width, double height, Beam beam, FlatDetector::NominalNormal nominalNormal, double distance, double pitch=0, double yaw=0, double roll=0, double offcenter_w=0, double offcenter_h=0) -> FlatDetector
+        __init__(FlatDetector self, size_t nxbins, size_t nybins, double width, double height, Beam beam, FlatDetector::NominalNormal nominalNormal, double distance, double offcenter_w=0, double offcenter_h=0, double pitch=0, double yaw=0, double roll=0) -> FlatDetector
         __init__(FlatDetector self, FlatDetector other) -> FlatDetector
         """
         _libBornAgainDevice.FlatDetector_swiginit(self, _libBornAgainDevice.new_FlatDetector(*args))
diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp
index 178a186e5983fa704695ff0a6778b4f1072a0579..6aebe15da247c24b976efc56041c099f52563802 100644
--- a/auto/Wrap/libBornAgainDevice_wrap.cpp
+++ b/auto/Wrap/libBornAgainDevice_wrap.cpp
@@ -41703,7 +41703,7 @@ static PyMethodDef SwigMethods[] = {
 	 { "IDetector_regionOfInterestBounds", _wrap_IDetector_regionOfInterestBounds, METH_VARARGS, "IDetector_regionOfInterestBounds(IDetector self, size_t iAxis) -> pvacuum_double_t"},
 	 { "IDetector_swigregister", IDetector_swigregister, METH_O, NULL},
 	 { "new_FlatDetector", _wrap_new_FlatDetector, METH_VARARGS, "\n"
-		"FlatDetector(size_t nxbins, size_t nybins, double width, double height, Beam beam, FlatDetector::NominalNormal nominalNormal, double distance, double pitch=0, double yaw=0, double roll=0, double offcenter_w=0, double offcenter_h=0)\n"
+		"FlatDetector(size_t nxbins, size_t nybins, double width, double height, Beam beam, FlatDetector::NominalNormal nominalNormal, double distance, double offcenter_w=0, double offcenter_h=0, double pitch=0, double yaw=0, double roll=0)\n"
 		"new_FlatDetector(FlatDetector other) -> FlatDetector\n"
 		""},
 	 { "delete_FlatDetector", _wrap_delete_FlatDetector, METH_O, "delete_FlatDetector(FlatDetector self)"},
diff --git a/rawEx/fit/scatter2d/expfit_galaxi.py b/rawEx/fit/scatter2d/expfit_galaxi.py
index b836b2223d72735e24a9fa89db1115f55e9d1051..19b9274c331420015e72b87ed05b8ee5bc5a1468 100755
--- a/rawEx/fit/scatter2d/expfit_galaxi.py
+++ b/rawEx/fit/scatter2d/expfit_galaxi.py
@@ -97,13 +97,13 @@ def create_detector(beam):
     nx = pilatus_npx
     ny = pilatus_npy
     s = pilatus_pixel_size
-    wx = nx*s 
+    wx = nx*s
     wy = ny*s
     u0 = beam_xpos*s  # in mm
     v0 = beam_ypos*s  # in mm
     return ba.FlatDetector(
         nx, ny, wx, wy, beam, ba.FlatDetector.T, detector_distance,
-        0, 0, 0, u0 - wx/2, v0 - wy/2)
+        u0 - wx/2, v0 - wy/2, 0, 0, 0)
 
 
 def create_simulation(P):