diff --git a/Core/Element/SpecularElement.cpp b/Core/Element/SpecularElement.cpp
index f85333e9431a06222e0ec057425cc89232b4b39d..6156d0e06710f671d4886d3283b96de5888c15a7 100644
--- a/Core/Element/SpecularElement.cpp
+++ b/Core/Element/SpecularElement.cpp
@@ -13,6 +13,7 @@
 //  ************************************************************************************************
 
 #include "Core/Element/SpecularElement.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Detector/IDetector.h"
 #include "Device/Instrument/Instrument.h"
 #include "Resample/Slice/KzComputation.h"
diff --git a/Core/Examples/StandardSimulations.cpp b/Core/Examples/StandardSimulations.cpp
index cc2eb4756e1785f6cb4827206ebbd09ef505e466..d2dc4280f5cd25fc97609052343b69cae45dd5cc 100644
--- a/Core/Examples/StandardSimulations.cpp
+++ b/Core/Examples/StandardSimulations.cpp
@@ -18,6 +18,7 @@
 #include "Core/Scan/AngularSpecScan.h"
 #include "Core/Scan/QSpecScan.h"
 #include "Core/Simulation/includeSimulations.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Beam/FootprintGauss.h"
 #include "Device/Beam/FootprintSquare.h"
 #include "Device/Detector/IsGISAXSDetector.h"
diff --git a/Core/Export/SimulationToPython.cpp b/Core/Export/SimulationToPython.cpp
index 8e3eb44ed350c0f3379fab942590c12bdc21350c..42ea7484750b70df298ffa02d514c26f98c3d362 100644
--- a/Core/Export/SimulationToPython.cpp
+++ b/Core/Export/SimulationToPython.cpp
@@ -24,6 +24,7 @@
 #include "Core/Scan/AngularSpecScan.h"
 #include "Core/Scan/QSpecScan.h"
 #include "Core/Simulation/includeSimulations.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Beam/FootprintGauss.h"
 #include "Device/Beam/FootprintSquare.h"
 #include "Device/Detector/RectangularDetector.h"
diff --git a/Core/Simulation/DepthProbeSimulation.cpp b/Core/Simulation/DepthProbeSimulation.cpp
index 52405ff11756970295543e0e98c5d709cf9c26ea..8e2a6426fca0bd2865255d802f567e83a825a4a3 100644
--- a/Core/Simulation/DepthProbeSimulation.cpp
+++ b/Core/Simulation/DepthProbeSimulation.cpp
@@ -15,6 +15,7 @@
 #include "Core/Simulation/DepthProbeSimulation.h"
 #include "Core/Background/IBackground.h"
 #include "Core/Computation/DepthProbeComputation.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Beam/IFootprintFactor.h"
 #include "Device/Detector/SpecularDetector1D.h"
 #include "Device/Histo/SimulationResult.h"
diff --git a/Core/Simulation/ISimulation.cpp b/Core/Simulation/ISimulation.cpp
index 698aed2ef12686859888e7ada696a438ceee5037..643b50b9e2c1995f6b5c92a531ff5f264fafca37 100644
--- a/Core/Simulation/ISimulation.cpp
+++ b/Core/Simulation/ISimulation.cpp
@@ -17,6 +17,7 @@
 #include "Core/Background/IBackground.h"
 #include "Core/Computation/IComputation.h"
 #include "Core/Simulation/MPISimulation.h"
+#include "Device/Beam/Beam.h"
 #include "Resample/Processed/ProcessedSample.h"
 #include "Sample/Multilayer/MultilayerUtils.h"
 #include "Sample/SampleBuilderEngine/ISampleBuilder.h"
diff --git a/Core/Simulation/ISimulation2D.cpp b/Core/Simulation/ISimulation2D.cpp
index ba580c4933363df7a9cbfdae4e30157c2ed57207..a311006ceac3a1471c71a30937e5e68efca26852 100644
--- a/Core/Simulation/ISimulation2D.cpp
+++ b/Core/Simulation/ISimulation2D.cpp
@@ -16,6 +16,7 @@
 #include "Base/Utils/Assert.h"
 #include "Core/Background/IBackground.h"
 #include "Core/Computation/DWBAComputation.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Detector/DetectorContext.h"
 #include "Resample/Element/DiffuseElement.h"
 
diff --git a/Core/Simulation/OffSpecularSimulation.cpp b/Core/Simulation/OffSpecularSimulation.cpp
index c6b58bac959181e1b16d7540f850158fb3d54986..350dbd4cbdee611f68b6ae5f5d31dd714b6098a1 100644
--- a/Core/Simulation/OffSpecularSimulation.cpp
+++ b/Core/Simulation/OffSpecularSimulation.cpp
@@ -14,6 +14,7 @@
 
 #include "Core/Simulation/OffSpecularSimulation.h"
 #include "Base/Pixel/RectangularPixel.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Detector/RectangularDetector.h"
 #include "Device/Detector/SphericalDetector.h"
 #include "Device/Histo/SimulationResult.h"
diff --git a/Core/Simulation/SpecularSimulation.cpp b/Core/Simulation/SpecularSimulation.cpp
index 2778fed6f63f4c3ce032b63186d8ea7220711bd6..22d7869be28dc2108b3a35772cfed815674d3b00 100644
--- a/Core/Simulation/SpecularSimulation.cpp
+++ b/Core/Simulation/SpecularSimulation.cpp
@@ -18,6 +18,7 @@
 #include "Core/Computation/SpecularComputation.h"
 #include "Core/Element/SpecularElement.h"
 #include "Core/Scan/AngularSpecScan.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Beam/IFootprintFactor.h"
 #include "Device/Coord/CoordSystem1D.h"
 #include "Device/Detector/SpecularDetector1D.h"
diff --git a/Device/Beam/Beam.cpp b/Device/Beam/Beam.cpp
index afe00e11a80b37b6099fb88eda5ec261ed83622e..c3bc776403abb75eb691fb6474e0cf9ba1897b00 100644
--- a/Device/Beam/Beam.cpp
+++ b/Device/Beam/Beam.cpp
@@ -78,6 +78,12 @@ Beam& Beam::operator=(const Beam& other)
 
 Beam::~Beam() = default;
 
+Beam* Beam::clone() const
+{
+    return new Beam(*this);
+}
+
+
 kvector_t Beam::getCentralK() const
 {
     return M_TWOPI / m_wavelength * Direction(-direction().alpha(), direction().phi()).vector();
diff --git a/Device/Beam/Beam.h b/Device/Beam/Beam.h
index 2d92ad12f7bd97f5ebacc00cd565124d04008f46..039b62a9c27b2689e20190af9842c42f145e0129 100644
--- a/Device/Beam/Beam.h
+++ b/Device/Beam/Beam.h
@@ -34,6 +34,8 @@ public:
 
     virtual ~Beam();
 
+    Beam* clone() const;
+
     static Beam horizontalBeam();
 
     void accept(INodeVisitor* visitor) const override { visitor->visit(this); }
diff --git a/Device/Instrument/Instrument.cpp b/Device/Instrument/Instrument.cpp
index 7895afa3098182cdf506efd4c4fc67ccde44f919..25bc82dc6f1f96f1eea376ed1bfc502c974e7155 100644
--- a/Device/Instrument/Instrument.cpp
+++ b/Device/Instrument/Instrument.cpp
@@ -14,6 +14,7 @@
 
 #include "Device/Instrument/Instrument.h"
 #include "Base/Pixel/RectangularPixel.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Detector/RectangularDetector.h"
 #include "Device/Detector/SphericalDetector.h"
 #include "Device/Histo/Histogram2D.h"
@@ -21,22 +22,19 @@
 #include "Device/Resolution/IResolutionFunction2D.h"
 
 Instrument::Instrument(const Beam& beam, const IDetector& detector)
-    : m_beam(beam), m_detector(detector.clone())
+    : m_beam(beam.clone()), m_detector(detector.clone())
 {
     setName("Instrument");
     registerChild(m_detector.get());
-    registerChild(&m_beam);
+    registerChild(m_beam.get());
     initDetector();
 }
 
 Instrument::Instrument() : Instrument(Beam::horizontalBeam(), SphericalDetector()) {}
 
-Instrument::Instrument(const Instrument& other) : INode(), m_beam(other.m_beam)
+Instrument::Instrument(const Instrument& other) :
+    Instrument(other.beam(), other.detector())
 {
-    if (other.m_detector)
-        setDetector(*other.m_detector);
-    registerChild(&m_beam);
-    setName(other.getName());
 }
 
 Instrument::~Instrument() = default;
@@ -44,10 +42,14 @@ Instrument::~Instrument() = default;
 Instrument& Instrument::operator=(const Instrument& other)
 {
     if (this != &other) {
-        m_beam = other.m_beam;
-        registerChild(&m_beam);
+        if (other.m_beam)
+            setBeam(*other.m_beam);
+        else
+            m_beam.release();
         if (other.m_detector)
             setDetector(*other.m_detector);
+        else
+            m_detector.release();
     }
     return *this;
 }
@@ -59,6 +61,14 @@ void Instrument::setDetector(const IDetector& detector)
     initDetector();
 }
 
+void Instrument::setBeam(const Beam& beam)
+{
+    m_beam.reset(beam.clone());
+    registerChild(m_beam.get());
+    if (m_detector)
+        initDetector();
+}
+
 void Instrument::initDetector()
 {
     if (!m_detector)
@@ -70,7 +80,7 @@ void Instrument::initDetector()
 std::vector<const INode*> Instrument::getChildren() const
 {
     std::vector<const INode*> result;
-    result.push_back(&m_beam);
+    result.push_back(m_beam.get());
     if (m_detector)
         result.push_back(m_detector.get());
     return result;
@@ -78,15 +88,8 @@ std::vector<const INode*> Instrument::getChildren() const
 
 void Instrument::setBeamParameters(double wavelength, double alpha_i, double phi_i)
 {
-    m_beam.setWavelength(wavelength);
-    m_beam.setDirection({alpha_i, phi_i});
-    if (m_detector)
-        initDetector();
-}
-
-void Instrument::setBeam(const Beam& beam)
-{
-    m_beam = beam;
+    m_beam->setWavelength(wavelength);
+    m_beam->setDirection({alpha_i, phi_i});
     if (m_detector)
         initDetector();
 }
diff --git a/Device/Instrument/Instrument.h b/Device/Instrument/Instrument.h
index d659110ae8e4eb5007f3d85ded34011d392d76ae..51c9038f5ddbb4b6a82dd0baab4290457a0a6087 100644
--- a/Device/Instrument/Instrument.h
+++ b/Device/Instrument/Instrument.h
@@ -20,9 +20,10 @@
 #ifndef BORNAGAIN_DEVICE_INSTRUMENT_INSTRUMENT_H
 #define BORNAGAIN_DEVICE_INSTRUMENT_INSTRUMENT_H
 
-#include "Device/Beam/Beam.h"
+#include "Param/Node/INode.h"
 #include <memory>
 
+class Beam;
 class CoordSystem2D;
 class IDetector;
 class IDetector2D;
@@ -40,8 +41,8 @@ public:
 
     void accept(INodeVisitor* visitor) const override { visitor->visit(this); }
 
-    Beam& beam() { return m_beam; }
-    const Beam& beam() const { return m_beam; }
+    Beam& beam() { return *m_beam; }
+    const Beam& beam() const { return *m_beam; }
     void setBeam(const Beam& beam);
 
     //! Sets the beam wavelength and incoming angles
@@ -63,7 +64,7 @@ public:
     CoordSystem2D* createScatteringCoords() const;
 
 protected:
-    Beam m_beam;
+    std::unique_ptr<Beam> m_beam;
     std::unique_ptr<IDetector> m_detector;
 };
 
diff --git a/Fit/Test/Minimizer/CMakeLists.txt b/Fit/Test/Minimizer/CMakeLists.txt
index e375597b886b8c97038cef8c79c631d41b5f0b83..6eec8369dbcc21f33f0900d0613b6682552b8d33 100644
--- a/Fit/Test/Minimizer/CMakeLists.txt
+++ b/Fit/Test/Minimizer/CMakeLists.txt
@@ -2,7 +2,7 @@ include(GoogleTest) # provides gtest_discover_tests
 
 set(test TestMinimizers)
 
-file(GLOB source_files "*.cpp")
+file(GLOB source_files *.cpp)
 
 add_executable(${test} ${source_files} ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp)
 target_include_directories(${test}
diff --git a/GUI/Models/DomainSimulationBuilder.cpp b/GUI/Models/DomainSimulationBuilder.cpp
index 63a655c20e38b58b8105bc63406995dd09b7d390..68685da3ec7b3de75b9c89ca692fc3f9c758c7fa 100644
--- a/GUI/Models/DomainSimulationBuilder.cpp
+++ b/GUI/Models/DomainSimulationBuilder.cpp
@@ -17,6 +17,7 @@
 #include "Core/Background/IBackground.h"
 #include "Core/Scan/AngularSpecScan.h"
 #include "Core/Simulation/includeSimulations.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Beam/IFootprintFactor.h"
 #include "GUI/Models/AxesItems.h"
 #include "GUI/Models/BackgroundItems.h"
diff --git a/GUI/Models/InstrumentItems.cpp b/GUI/Models/InstrumentItems.cpp
index f0ec01bd5976ef0581f900fca0f18f64566b5fad..d422278b321b54b8c58aefffd89e4a8767082abe 100644
--- a/GUI/Models/InstrumentItems.cpp
+++ b/GUI/Models/InstrumentItems.cpp
@@ -16,6 +16,7 @@
 #include "Base/Const/Units.h"
 #include "Base/Pixel/RectangularPixel.h"
 #include "Core/Simulation/DepthProbeSimulation.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Coord/CoordSystem1D.h"
 #include "Device/Detector/RectangularDetector.h"
 #include "Device/Detector/SphericalDetector.h"
diff --git a/GUI/Models/TransformFromDomain.cpp b/GUI/Models/TransformFromDomain.cpp
index be4c03fd9f3187d53ef22d36154ea6f5100d52db..e938889e8e01d473e8a24b5f7b98e984ab5fe4da 100644
--- a/GUI/Models/TransformFromDomain.cpp
+++ b/GUI/Models/TransformFromDomain.cpp
@@ -19,6 +19,7 @@
 #include "Core/Export/NodeProgeny.h"
 #include "Core/Scan/AngularSpecScan.h"
 #include "Core/Simulation/includeSimulations.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Beam/FootprintGauss.h"
 #include "Device/Beam/FootprintSquare.h"
 #include "Device/Detector/RectangularDetector.h"
diff --git a/GUI/ba3d/CMakeLists.txt b/GUI/ba3d/CMakeLists.txt
index 4f967bcc4f53def8c752f76dd1636ff93c1a9129..4d95508e0aa4f34c77389c7d883ef48f2fcdb583 100644
--- a/GUI/ba3d/CMakeLists.txt
+++ b/GUI/ba3d/CMakeLists.txt
@@ -3,7 +3,7 @@ set(lib ba3d)
 file (GLOB_RECURSE source_files *.cpp)
 
 set(CMAKE_AUTORCC ON)
-qt5_add_resources(RC_SHADERS "shaders.qrc")
+qt5_add_resources(RC_SHADERS shaders.qrc)
 
 add_library (${lib} STATIC ${source_files} ${RC_SHADERS})
 target_include_directories(${lib} PUBLIC ${CMAKE_SOURCE_DIR})
diff --git a/Tests/Functional/Core/Consistence/CMakeLists.txt b/Tests/Functional/Core/Consistence/CMakeLists.txt
index 83e1bd8a9034b69149549178a29a12738a34abbb..c5c27fc4c2114ed7bcaeef171e57d8b024984197 100644
--- a/Tests/Functional/Core/Consistence/CMakeLists.txt
+++ b/Tests/Functional/Core/Consistence/CMakeLists.txt
@@ -2,7 +2,7 @@ include(GoogleTest) # provides gtest_discover_tests
 
 set(test TestCoreConsistence)
 
-file(GLOB source_files "*.cpp")
+file(GLOB source_files *.cpp)
 
 add_executable(${test} ${source_files} ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp)
 
diff --git a/Tests/Functional/Core/Fitting/CMakeLists.txt b/Tests/Functional/Core/Fitting/CMakeLists.txt
index 0c5d4ced3bbdafe2f573a55c282231a7d40c01fe..d5c0b0e6564392fb8885d2d33988999205876039 100644
--- a/Tests/Functional/Core/Fitting/CMakeLists.txt
+++ b/Tests/Functional/Core/Fitting/CMakeLists.txt
@@ -2,7 +2,7 @@ include(GoogleTest) # provides gtest_discover_tests
 
 set(test TestCoreFitting)
 
-file(GLOB source_files "*.cpp")
+file(GLOB source_files *.cpp)
 
 add_executable(${test} ${source_files} ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp)
 target_include_directories(${test}
diff --git a/Tests/Functional/GUI/CMakeLists.txt b/Tests/Functional/GUI/CMakeLists.txt
index e4f7bbc5b738e9261bb17fbfad0e2e720b263adc..b5abd0ddaf61c1133d66b6855e078bd7447de1cd 100644
--- a/Tests/Functional/GUI/CMakeLists.txt
+++ b/Tests/Functional/GUI/CMakeLists.txt
@@ -1 +1,36 @@
-add_subdirectory(Std)
+#   ************************************************************************************************
+#
+#   BornAgain: simulate and fit scattering at grazing incidence
+#
+#!  @file      Tests/Functional/GUI/Std/CMakeLists.txt
+#!  @brief     Builds GUI standard tests.
+#
+#              .../Std/TestAll.cpp provides main, which essentially runs RUN_ALL_TESTS().
+#              RUN_ALL_TESTS is a gtest macro that runs tests defined by TEST_F macros.
+#              .../Std/Run.cpp uses such TEST_F macros to define our standard test cases.
+#              Check.cpp provides a callback function that executes one GUI tests:
+#              Run a given simulation directly, and through GUI model, and compare results.
+#
+#!  @homepage  http://www.bornagainproject.org
+#!  @license   GNU General Public License v3 or higher (see COPYING)
+#!  @copyright Forschungszentrum Jülich GmbH 2018
+#!  @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
+#
+#   ************************************************************************************************
+
+include(GoogleTest) # provides gtest_discover_tests
+
+set(test TestGuiStd)
+
+set(source_files Check.cpp ../Std/Run.cpp ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp)
+
+add_executable(${test} ${source_files})
+target_compile_options(${test} PUBLIC -DGUI_STD_TEST)
+target_compile_definitions(${test} PUBLIC DISABLE_DISTRIBUTION_TESTS)
+
+target_include_directories(${test} PUBLIC
+    ${BornAgainGUI_INCLUDE_DIRS}
+    ${CMAKE_SOURCE_DIR}/3rdparty/common/gtest/gtest-1.8.0/include)
+target_link_libraries(${test} BornAgainGUI gtest)
+
+gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Gui.)
diff --git a/Tests/Functional/GUI/Std/Check.cpp b/Tests/Functional/GUI/Check.cpp
similarity index 100%
rename from Tests/Functional/GUI/Std/Check.cpp
rename to Tests/Functional/GUI/Check.cpp
diff --git a/Tests/Functional/GUI/Std/CMakeLists.txt b/Tests/Functional/GUI/Std/CMakeLists.txt
deleted file mode 100644
index 48cbd7bded97560d1b230a6485bd84b201d3cb36..0000000000000000000000000000000000000000
--- a/Tests/Functional/GUI/Std/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-#   ************************************************************************************************
-#
-#   BornAgain: simulate and fit scattering at grazing incidence
-#
-#!  @file      Tests/Functional/GUI/Std/CMakeLists.txt
-#!  @brief     Builds GUI standard tests.
-#
-#              .../Std/TestAll.cpp provides main, which essentially runs RUN_ALL_TESTS().
-#              RUN_ALL_TESTS is a gtest macro that runs tests defined by TEST_F macros.
-#              .../Std/Run.cpp uses such TEST_F macros to define our standard test cases.
-#              Check.cpp provides a callback function that executes one GUI tests:
-#              Run a given simulation directly, and through GUI model, and compare results.
-#
-#!  @homepage  http://www.bornagainproject.org
-#!  @license   GNU General Public License v3 or higher (see COPYING)
-#!  @copyright Forschungszentrum Jülich GmbH 2018
-#!  @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
-#
-#   ************************************************************************************************
-
-include(GoogleTest) # provides gtest_discover_tests
-
-set(test TestGuiStd)
-
-set(source_files Check.cpp ../../Std/Run.cpp ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp)
-
-add_executable(${test} ${source_files})
-target_compile_options(${test} PUBLIC -DGUI_STD_TEST)
-target_compile_definitions(${test} PUBLIC DISABLE_DISTRIBUTION_TESTS)
-
-target_include_directories(${test} PUBLIC
-    ${BornAgainGUI_INCLUDE_DIRS}
-    ${CMAKE_SOURCE_DIR}/3rdparty/common/gtest/gtest-1.8.0/include)
-target_link_libraries(${test} BornAgainGUI gtest)
-
-gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Gui.)
diff --git a/Tests/Functional/PyCore/CMakeLists.txt b/Tests/Functional/PyCore/CMakeLists.txt
index ed485d869195f64871f6b7fbb27ed88ec86b39b1..b1f1a2dd5cdf299f7a12da1ea38cc50801fb345b 100644
--- a/Tests/Functional/PyCore/CMakeLists.txt
+++ b/Tests/Functional/PyCore/CMakeLists.txt
@@ -5,10 +5,10 @@
 set(OUTPUT_DIR ${TEST_OUTPUT_DIR_PY_CORE})
 file(MAKE_DIRECTORY ${OUTPUT_DIR})
 
-file(GLOB tests RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.py")
+file(GLOB tests RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py)
 list(REMOVE_ITEM tests utils.py)
 if(NOT BORNAGAIN_TIFF_SUPPORT)
-    list(REMOVE_ITEM tests "intensitydata_io_tiff.py")
+    list(REMOVE_ITEM tests intensitydata_io_tiff.py)
 endif()
 
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/utils.py ${OUTPUT_DIR}/utils.py @ONLY)
diff --git a/Tests/Functional/PyEmbedded/CMakeLists.txt b/Tests/Functional/PyEmbedded/CMakeLists.txt
index e42ea93cc8cf21e1be81c6db2cc49ef77f12b431..cfaf2bd6d0172e4b38115a74bdd9405a37d2e7da 100644
--- a/Tests/Functional/PyEmbedded/CMakeLists.txt
+++ b/Tests/Functional/PyEmbedded/CMakeLists.txt
@@ -2,7 +2,7 @@ include(GoogleTest) # provides gtest_discover_tests
 
 set(test TestPyEmbedded)
 
-file(GLOB source_files "*.cpp")
+file(GLOB source_files *.cpp)
 
 add_executable(${test} ${source_files} ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp)
 target_include_directories(${test}
diff --git a/Tests/Functional/PyFit/CMakeLists.txt b/Tests/Functional/PyFit/CMakeLists.txt
index 133fcae57fa9671cad5d9c457779428153694d90..a13539beea047e29f7455262be91209c7f0d28f3 100644
--- a/Tests/Functional/PyFit/CMakeLists.txt
+++ b/Tests/Functional/PyFit/CMakeLists.txt
@@ -5,7 +5,7 @@
 set(output_dir ${TEST_OUTPUT_DIR_PY_FIT})
 file(MAKE_DIRECTORY ${output_dir})
 
-file(GLOB tests RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.py")
+file(GLOB tests RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py)
 
 foreach(_test ${tests})
     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${_test} ${output_dir}/${_test} COPYONLY)
diff --git a/Tests/Performance/Core/Mesocrystal.cpp b/Tests/Performance/Core/Mesocrystal.cpp
index af3d57dbf67119f8843240c68285f63e9cc2f181..4f479f253c4c365bd2369d5ec901681d7c2f7dcd 100644
--- a/Tests/Performance/Core/Mesocrystal.cpp
+++ b/Tests/Performance/Core/Mesocrystal.cpp
@@ -15,6 +15,7 @@
 #include "Sample/Particle/MesoCrystal.h"
 #include "Base/Const/Units.h"
 #include "Core/Simulation/GISASSimulation.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Detector/RectangularDetector.h"
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/FormFactorCylinder.h"
diff --git a/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp b/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp
index 58236e2990c5cf4e56861abd159d8cdd78762e3d..bf413846cbdd56afbdfcd56e6441af293d372c46 100644
--- a/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp
+++ b/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp
@@ -1,6 +1,7 @@
 #include "Core/Simulation/DepthProbeSimulation.h"
 #include "Base/Const/Units.h"
 #include "Base/Math/Constants.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Histo/Histogram2D.h"
 #include "Device/Histo/SimulationResult.h"
 #include "Param/Distrib/Distributions.h"
diff --git a/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp b/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp
index 26a8c5b0f4eeb2fd2ffd91e70e62994f1e30a896..3d691bc61697dca1da3becc47674c655edbf3063 100644
--- a/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp
+++ b/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp
@@ -5,6 +5,7 @@
 #include "Core/Background/ConstantBackground.h"
 #include "Core/Scan/AngularSpecScan.h"
 #include "Core/Scan/QSpecScan.h"
+#include "Device/Beam/Beam.h"
 #include "Device/Histo/Histogram1D.h"
 #include "Device/Histo/SimulationResult.h"
 #include "Param/Distrib/Distributions.h"
diff --git a/Tests/UnitTests/GUI/CMakeLists.txt b/Tests/UnitTests/GUI/CMakeLists.txt
index 21b1f4a51689ea6a38ab5811764d9dee6d83e17b..b9f9184de0f697e4c7e56c9506765524e8a24c38 100644
--- a/Tests/UnitTests/GUI/CMakeLists.txt
+++ b/Tests/UnitTests/GUI/CMakeLists.txt
@@ -2,7 +2,7 @@ include(GoogleTest)
 
 set(test UnitTestGUI)
 
-file(GLOB source_files "*.cpp")
+file(GLOB source_files *.cpp)
 
 find_package(Qt5Core REQUIRED)
 find_package(Qt5Test REQUIRED)
diff --git a/auto/Wrap/doxygenDevice.i b/auto/Wrap/doxygenDevice.i
index 3fe763be8652bed586a2498259bab10da0271b81..6c3b4bdcdcf6d0495c2ed84570a901a0000fd61f 100644
--- a/auto/Wrap/doxygenDevice.i
+++ b/auto/Wrap/doxygenDevice.i
@@ -75,6 +75,9 @@ C++ includes: Beam.h
 %feature("docstring")  Beam::~Beam "Beam::~Beam()
 ";
 
+%feature("docstring")  Beam::clone "Beam * Beam::clone() const
+";
+
 %feature("docstring")  Beam::accept "void Beam::accept(INodeVisitor *visitor) const override
 ";
 
diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py
index 530114778e1adf2a350d182291cdcb1563f778dc..c4dab083422bd622cac733ef047b98efe840c8c3 100644
--- a/auto/Wrap/libBornAgainDevice.py
+++ b/auto/Wrap/libBornAgainDevice.py
@@ -2710,6 +2710,14 @@ class Beam(libBornAgainParam.INode):
         _libBornAgainDevice.Beam_swiginit(self, _libBornAgainDevice.new_Beam(*args))
     __swig_destroy__ = _libBornAgainDevice.delete_Beam
 
+    def clone(self):
+        r"""
+        clone(Beam self) -> Beam
+        Beam * Beam::clone() const
+
+        """
+        return _libBornAgainDevice.Beam_clone(self)
+
     @staticmethod
     def horizontalBeam():
         r"""horizontalBeam() -> Beam"""
diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp
index 6fdfcc68c32688865c721556f265e7e3847a18ac..c4207133f5befe5133b8d17d7599b70ccefa9a9a 100644
--- a/auto/Wrap/libBornAgainDevice_wrap.cpp
+++ b/auto/Wrap/libBornAgainDevice_wrap.cpp
@@ -31126,6 +31126,29 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_Beam_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Beam *arg1 = (Beam *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject *swig_obj[1] ;
+  Beam *result = 0 ;
+  
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Beam, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Beam_clone" "', argument " "1"" of type '" "Beam const *""'"); 
+  }
+  arg1 = reinterpret_cast< Beam * >(argp1);
+  result = (Beam *)((Beam const *)arg1)->clone();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Beam, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_Beam_horizontalBeam(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   SwigValueWrapper< Beam > result;
@@ -44960,6 +44983,11 @@ static PyMethodDef SwigMethods[] = {
 		"Beam::~Beam()\n"
 		"\n"
 		""},
+	 { "Beam_clone", _wrap_Beam_clone, METH_O, "\n"
+		"Beam_clone(Beam self) -> Beam\n"
+		"Beam * Beam::clone() const\n"
+		"\n"
+		""},
 	 { "Beam_horizontalBeam", _wrap_Beam_horizontalBeam, METH_NOARGS, "Beam_horizontalBeam() -> Beam"},
 	 { "Beam_accept", _wrap_Beam_accept, METH_VARARGS, "\n"
 		"Beam_accept(Beam self, INodeVisitor * visitor)\n"
diff --git a/cmake/BornAgain/Dependences.cmake b/cmake/BornAgain/Dependences.cmake
index 5a2c3b2957263f1969cae735c4ddecaadfd5ab3d..5f23a41613532d84569111d75cdeef5a2e948a14 100644
--- a/cmake/BornAgain/Dependences.cmake
+++ b/cmake/BornAgain/Dependences.cmake
@@ -26,15 +26,15 @@ if(NOT Cerf_IS_CPP)
         "${CMAKE_BINARY_DIR}/temp"
         "${CMAKE_SOURCE_DIR}/cmake/tests/test_libcerf.cpp"
         CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${Cerf_INCLUDE_DIR};${CMAKE_SOURCE_DIR}"
-        LINK_LIBRARIES "${Cerf_LIBRARIES}"
-        OUTPUT_VARIABLE COMPILE_OUT) 
+        LINK_LIBRARIES ${Cerf_LIBRARIES}
+        OUTPUT_VARIABLE COMPILE_OUT)
     if(NOT COMPILE_OK)
         try_compile(COMPILE_OK
             "${CMAKE_BINARY_DIR}/temp"
             "${CMAKE_SOURCE_DIR}/cmake/tests/test_libcerf.cpp"
             COMPILE_DEFINITIONS "-DLIBCERF_WITHOUT_TYPEDEF"
             CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${Cerf_INCLUDE_DIR};${CMAKE_SOURCE_DIR}"
-            LINK_LIBRARIES "${Cerf_LIBRARIES}")
+            LINK_LIBRARIES ${Cerf_LIBRARIES})
         if(COMPILE_OK)
             add_definitions("-DLIBCERF_WITHOUT_TYPEDEF")
         else()
@@ -43,7 +43,7 @@ if(NOT Cerf_IS_CPP)
         endif()
     endif()
 endif()
-  
+
 if(Cerf_IS_CPP)
     add_compile_definitions(CERF_AS_CPP=ON)
 endif()
@@ -161,7 +161,7 @@ endif()
 
 if(WIN32)
     ## Boost libraries
-    # The list ${Boost_LIBRARIES} can contain either only dll names (if e.g. debug dlls are 
+    # The list ${Boost_LIBRARIES} can contain either only dll names (if e.g. debug dlls are
     # not found), or keyword/dll pairs (if debug and release dlls have been found). This has
     # to be taken care of in the iteration over the list.
     # debug DLLs are ignored for installation
@@ -248,12 +248,12 @@ if(WIN32)
                 set(entryShallBeSkipped false)
                 continue()
             endif()
-    
+
             if (${LIB} STREQUAL "debug")
                 set(entryShallBeSkipped true)
                 continue()
             endif()
-    
+
             if (${LIB} STREQUAL "optimized")
                 set(entryShallBeSkipped false)
                 continue()
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index d698fadc9a907469e27569ba514ff19c7750844e..2efc786572e268dde2fae60c5c1bfdbaba42c00a 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -21,5 +21,5 @@ install(CODE "MESSAGE(\"${after_install_text}\")")
 endif()
 
 # to show files in Qt creator
-FILE(GLOB_RECURSE ScriptFiles "configurables/*.*")
+FILE(GLOB_RECURSE ScriptFiles configurables/*.*)
 add_custom_target(scripts SOURCES ${ScriptFiles})