diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CalculateDIFC.h b/Framework/Algorithms/inc/MantidAlgorithms/CalculateDIFC.h
index 1aac013bd2f13cdfa7ab9bd0ddcb5be3ba3abcd4..ccab984903b0419153508da7c916cfe3faf0e999 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CalculateDIFC.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CalculateDIFC.h
@@ -42,12 +42,6 @@ public:
 private:
   void init() override;
   void exec() override;
-
-  /// Calculate the DIFC for every pixel
-  void calculate(API::Progress &progress, API::MatrixWorkspace_sptr &outputWs,
-                 DataObjects::OffsetsWorkspace_sptr &offsetsWS, double l1,
-                 double beamlineNorm, Kernel::V3D &beamline,
-                 Kernel::V3D &samplePos, const API::DetectorInfo &detectorInfo);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ConvertSpectrumAxis2.h b/Framework/Algorithms/inc/MantidAlgorithms/ConvertSpectrumAxis2.h
index b1b72002f44b7ce2e52155ef135081408d8c8750..7a46bb91dc1d6dd68b20467fe4db6c1a0eccef11 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ConvertSpectrumAxis2.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ConvertSpectrumAxis2.h
@@ -8,6 +8,10 @@
 #include "MantidGeometry/IDetector.h"
 
 namespace Mantid {
+namespace API {
+class DetectorInfo;
+class MatrixWorkspace;
+}
 namespace Algorithms {
 /** Converts the representation of the vertical axis (the one up the side of
     a matrix in MantidPlot) of a Workspace2D from its default of holding the
@@ -70,10 +74,10 @@ private:
   void exec() override;
   /// Converting to theta.
   void createThetaMap(API::Progress &progress, const std::string &targetUnit,
-                      API::MatrixWorkspace_sptr &inputWS, size_t nHist);
+                      API::MatrixWorkspace_sptr &inputWS);
   /// Converting to Q and QSquared
   void createElasticQMap(API::Progress &progress, const std::string &targetUnit,
-                         API::MatrixWorkspace_sptr &inputWS, size_t nHist);
+                         API::MatrixWorkspace_sptr &inputWS);
   /// Creates an output workspace.
   API::MatrixWorkspace_sptr
   createOutputWorkspace(API::Progress &progress, const std::string &targetUnit,
@@ -83,8 +87,9 @@ private:
   std::multimap<double, size_t> m_indexMap;
 
   /// Getting Efixed
-  double getEfixed(const Mantid::Geometry::IDetector &detector,
-                   API::MatrixWorkspace_const_sptr inputWS, int emode) const;
+  double getEfixed(const size_t detectorIndex,
+                   const Mantid::API::DetectorInfo &detectorInfo,
+                   const API::MatrixWorkspace &inputWS, const int emode) const;
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreateLogTimeCorrection.h b/Framework/Algorithms/inc/MantidAlgorithms/CreateLogTimeCorrection.h
index b7809a6b87de6618f8dd2a0a5567bb28010a797d..168b8525a42bf3eb889d1067379726aa34e3b964 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CreateLogTimeCorrection.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CreateLogTimeCorrection.h
@@ -6,8 +6,12 @@
 #include "MantidAPI/MatrixWorkspace_fwd.h"
 #include "MantidDataObjects/TableWorkspace.h"
 #include "MantidGeometry/Instrument.h"
+#include <vector>
 
 namespace Mantid {
+namespace API {
+class DetectorInfo;
+}
 namespace Algorithms {
 
 /** CreateLogTimeCorrection : Create correction file and workspace to correct
@@ -60,24 +64,24 @@ private:
   /// Implement abstract Algorithm methods
   void exec() override;
 
-  /// Get instrument geometry setup including L2 for each detector and L1
-  void getInstrumentSetup();
+  /// Log geometry information
+  void
+  logGeometryInformation(const Mantid::API::DetectorInfo &detectorInfo) const;
 
   /// Calculate the log time correction for each pixel, i.e., correcton from
   /// event time at detector to time at sample
-  void calculateCorrection();
+  std::vector<double>
+  calculateCorrections(const Mantid::API::DetectorInfo &detectorInfo) const;
 
   /// Write L2 map and correction map to a TableWorkspace
-  DataObjects::TableWorkspace_sptr generateCorrectionTable();
+  DataObjects::TableWorkspace_sptr
+  generateCorrectionTable(const Mantid::API::DetectorInfo &detectorInfo,
+                          const std::vector<double> &corrections) const;
 
   /// Write correction map to a text file
-  void writeCorrectionToFile(std::string filename);
-
-  API::MatrixWorkspace_sptr m_dataWS;
-  Geometry::Instrument_const_sptr m_instrument;
-  std::map<int, double> m_l2map;
-  std::map<int, double> m_correctionMap;
-  double m_L1 = 0.0;
+  void writeCorrectionToFile(const std::string filename,
+                             const Mantid::API::DetectorInfo &detectorInfo,
+                             const std::vector<double> &corrections) const;
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/src/AddPeak.cpp b/Framework/Algorithms/src/AddPeak.cpp
index 39201982676402f3437ebc15ad550abd4be7f37a..7e35ebf9f655a4bba066e042efce73a83bde8db7 100644
--- a/Framework/Algorithms/src/AddPeak.cpp
+++ b/Framework/Algorithms/src/AddPeak.cpp
@@ -1,10 +1,11 @@
 #include "MantidAlgorithms/AddPeak.h"
-
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/IPeaksWorkspace.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/Run.h"
+#include "MantidAPI/DetectorInfo.h"
 #include "MantidGeometry/Crystal/IPeak.h"
+#include "MantidGeometry/IDetector.h"
 #include "MantidGeometry/Instrument/Goniometer.h"
 #include "MantidKernel/Unit.h"
 #include "MantidKernel/System.h"
@@ -46,22 +47,19 @@ void AddPeak::exec() {
   const double height = getProperty("Height");
   const double count = getProperty("BinCount");
 
-  Mantid::Geometry::Instrument_const_sptr instr = runWS->getInstrument();
-  Mantid::Geometry::IComponent_const_sptr source = instr->getSource();
-  Mantid::Geometry::IComponent_const_sptr sample = instr->getSample();
-  Mantid::Geometry::IDetector_const_sptr det = instr->getDetector(detID);
+  const DetectorInfo &detectorInfo = runWS->detectorInfo();
+  const size_t detectorIndex = detectorInfo.indexOf(detID);
 
-  const Mantid::Kernel::V3D samplePos = sample->getPos();
-  const Mantid::Kernel::V3D beamLine = samplePos - source->getPos();
-  double theta2 = det->getTwoTheta(samplePos, beamLine);
-  double phi = det->getPhi();
+  double theta2 = detectorInfo.twoTheta(detectorIndex);
+  const Mantid::Geometry::IDetector &det = detectorInfo.detector(detectorIndex);
+  double phi = det.getPhi();
 
   // In the inelastic convention, Q = ki - kf.
   double Qx = -sin(theta2) * cos(phi);
   double Qy = -sin(theta2) * sin(phi);
   double Qz = 1.0 - cos(theta2);
-  double l1 = source->getDistance(*sample);
-  double l2 = det->getDistance(*sample);
+  double l1 = detectorInfo.l1();
+  double l2 = detectorInfo.l2(detectorIndex);
 
   Mantid::Kernel::Unit_sptr unit = runWS->getAxis(0)->unit();
   if (unit->unitID() != "TOF") {
@@ -74,13 +72,13 @@ void AddPeak::exec() {
         Mantid::Kernel::Property *prop = run.getProperty("Ei");
         efixed = boost::lexical_cast<double, std::string>(prop->value());
       }
-    } else if (det->hasParameter("Efixed")) {
+    } else if (det.hasParameter("Efixed")) {
       emode = 2; // indirect
       try {
         const Mantid::Geometry::ParameterMap &pmap =
             runWS->constInstrumentParameters();
         Mantid::Geometry::Parameter_sptr par =
-            pmap.getRecursive(det.get(), "Efixed");
+            pmap.getRecursive(&det, "Efixed");
         if (par) {
           efixed = par->value<double>();
         }
@@ -90,7 +88,7 @@ void AddPeak::exec() {
     } else {
       // m_emode = 0; // Elastic
       // This should be elastic if Ei and Efixed are not set
-      // TODO?
+      // TODO
     }
     std::vector<double> xdata(1, tof);
     std::vector<double> ydata;
diff --git a/Framework/Algorithms/src/CalculateDIFC.cpp b/Framework/Algorithms/src/CalculateDIFC.cpp
index 9aeeaecce80eb65034bf7e45d5a57cf5e25912c3..3e8548f8a80faace333142c9e787641c2aac91aa 100644
--- a/Framework/Algorithms/src/CalculateDIFC.cpp
+++ b/Framework/Algorithms/src/CalculateDIFC.cpp
@@ -3,6 +3,36 @@
 #include "MantidGeometry/IDetector.h"
 
 namespace Mantid {
+
+namespace {
+
+void calculate(API::Progress &progress, API::MatrixWorkspace_sptr &outputWs,
+               DataObjects::OffsetsWorkspace_sptr &offsetsWS,
+               const API::DetectorInfo &detectorInfo) {
+  DataObjects::SpecialWorkspace2D_sptr localWS =
+      boost::dynamic_pointer_cast<DataObjects::SpecialWorkspace2D>(outputWs);
+
+  const auto &detectorIDs = detectorInfo.detectorIDs();
+
+  const double l1 = detectorInfo.l1();
+  // Now go through all
+  for (size_t i = 0; i < detectorInfo.size(); ++i) {
+    if ((!detectorInfo.isMasked(i)) && (!detectorInfo.isMonitor(i))) {
+      double offset = 0.;
+      if (offsetsWS)
+        offset = offsetsWS->getValue(detectorIDs[i], 0.);
+
+      double difc = Geometry::Conversion::tofToDSpacingFactor(
+          l1, detectorInfo.l2(i), detectorInfo.twoTheta(i), offset);
+      difc = 1. / difc; // tofToDSpacingFactor gives 1/DIFC
+      localWS->setValue(detectorIDs[i], difc);
+    }
+
+    progress.report("Calculate DIFC");
+  }
+}
+}
+
 namespace Algorithms {
 
 using Mantid::API::MatrixWorkspace;
@@ -70,50 +100,13 @@ void CalculateDIFC::exec() {
     outputWs->setTitle("DIFC workspace");
   }
 
-  double l1;
-  Kernel::V3D beamline, samplePos;
-  double beamlineNorm;
-
-  inputWs->getInstrument()->getInstrumentParameters(l1, beamline, beamlineNorm,
-                                                    samplePos);
-
   const auto &detectorInfo = inputWs->detectorInfo();
 
   API::Progress progress(this, 0, 1, detectorInfo.size());
-  calculate(progress, outputWs, offsetsWs, l1, beamlineNorm, beamline,
-            samplePos, detectorInfo);
+  calculate(progress, outputWs, offsetsWs, detectorInfo);
 
   setProperty("OutputWorkspace", outputWs);
 }
 
-void CalculateDIFC::calculate(API::Progress &progress,
-                              API::MatrixWorkspace_sptr &outputWs,
-                              DataObjects::OffsetsWorkspace_sptr &offsetsWS,
-                              double l1, double beamlineNorm,
-                              Kernel::V3D &beamline, Kernel::V3D &samplePos,
-                              const API::DetectorInfo &detectorInfo) {
-  SpecialWorkspace2D_sptr localWS =
-      boost::dynamic_pointer_cast<SpecialWorkspace2D>(outputWs);
-
-  const auto &detectorIDs = detectorInfo.detectorIDs();
-
-  // Now go through all
-  for (size_t i = 0; i < detectorInfo.size(); ++i) {
-    if ((!detectorInfo.isMasked(i)) && (!detectorInfo.isMonitor(i))) {
-      double offset = 0.;
-      if (offsetsWS)
-        offset = offsetsWS->getValue(detectorIDs[i], 0.);
-
-      double difc = Geometry::Instrument::calcConversion(
-          l1, beamline, beamlineNorm, samplePos, detectorInfo.position(i),
-          offset);
-      difc = 1. / difc; // calcConversion gives 1/DIFC
-      localWS->setValue(detectorIDs[i], difc);
-    }
-
-    progress.report("Calculate DIFC");
-  }
-}
-
 } // namespace Algorithms
 } // namespace Mantid
diff --git a/Framework/Algorithms/src/ConvertDiffCal.cpp b/Framework/Algorithms/src/ConvertDiffCal.cpp
index 6d95ac735057d0ab6595b1473b91479f4bef4c44..2a48206e70becdc009e47e86bb2318d967d6f987 100644
--- a/Framework/Algorithms/src/ConvertDiffCal.cpp
+++ b/Framework/Algorithms/src/ConvertDiffCal.cpp
@@ -1,9 +1,12 @@
 #include "MantidAlgorithms/ConvertDiffCal.h"
 #include "MantidAPI/IAlgorithm.h"
+#include "MantidAPI/SpectrumInfo.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidDataObjects/OffsetsWorkspace.h"
 #include "MantidDataObjects/TableWorkspace.h"
+#include "MantidKernel/PhysicalConstants.h"
 #include "MantidGeometry/Instrument.h"
+#include "MantidGeometry/IComponent.h"
 
 namespace Mantid {
 namespace Algorithms {
@@ -94,26 +97,18 @@ double getOffset(OffsetsWorkspace_const_sptr offsetsWS, const detid_t detid) {
 /**
  * @param offsetsWS
  * @param index
+ * @param spectrumInfo
  * @return The offset adjusted value of DIFC
  */
-double calculateDIFC(OffsetsWorkspace_const_sptr offsetsWS,
-                     const size_t index) {
-  Instrument_const_sptr instrument = offsetsWS->getInstrument();
-
+double calculateDIFC(OffsetsWorkspace_const_sptr offsetsWS, const size_t index,
+                     const Mantid::API::SpectrumInfo &spectrumInfo) {
   const detid_t detid = getDetID(offsetsWS, index);
   const double offset = getOffset(offsetsWS, detid);
-
-  double l1;
-  Kernel::V3D beamline, samplePos;
-  double beamline_norm;
-  instrument->getInstrumentParameters(l1, beamline, beamline_norm, samplePos);
-
-  Geometry::IDetector_const_sptr detector = instrument->getDetector(detid);
-
   // the factor returned is what is needed to convert TOF->d-spacing
   // the table is supposed to be filled with DIFC which goes the other way
-  const double factor = Instrument::calcConversion(
-      l1, beamline, beamline_norm, samplePos, detector->getPos(), offset);
+  const double factor = Mantid::Geometry::Conversion::tofToDSpacingFactor(
+      spectrumInfo.l1(), spectrumInfo.l2(index), spectrumInfo.twoTheta(index),
+      offset);
   return 1. / factor;
 }
 
@@ -134,10 +129,11 @@ void ConvertDiffCal::exec() {
   const size_t numberOfSpectra = offsetsWS->getNumberHistograms();
   Progress progress(this, 0.0, 1.0, numberOfSpectra);
 
+  const Mantid::API::SpectrumInfo &spectrumInfo = offsetsWS->spectrumInfo();
   for (size_t i = 0; i < numberOfSpectra; ++i) {
     API::TableRow newrow = configWksp->appendRow();
     newrow << static_cast<int>(getDetID(offsetsWS, i));
-    newrow << calculateDIFC(offsetsWS, i);
+    newrow << calculateDIFC(offsetsWS, i, spectrumInfo);
     newrow << 0.; // difa
     newrow << 0.; // tzero
 
diff --git a/Framework/Algorithms/src/ConvertSpectrumAxis.cpp b/Framework/Algorithms/src/ConvertSpectrumAxis.cpp
index 8d7d1252590090f4fbce57f648fa8330a7cff05b..faa39372917afbb0d52080dcab86eebefdd70ce0 100644
--- a/Framework/Algorithms/src/ConvertSpectrumAxis.cpp
+++ b/Framework/Algorithms/src/ConvertSpectrumAxis.cpp
@@ -75,6 +75,7 @@ void ConvertSpectrumAxis::exec() {
   const size_t nHist = inputWS->getNumberHistograms();
   const size_t nBins = inputWS->blocksize();
   const bool isHist = inputWS->isHistogramData();
+  auto &spectrumInfo = inputWS->spectrumInfo();
   size_t nxBins;
   if (isHist) {
     nxBins = nBins + 1;
@@ -84,10 +85,8 @@ void ConvertSpectrumAxis::exec() {
   if (unitTarget != "theta" && unitTarget != "signed_theta") {
     Kernel::Unit_sptr fromUnit = inputWS->getAxis(0)->unit();
     Kernel::Unit_sptr toUnit = UnitFactory::Instance().create(unitTarget);
-    IComponent_const_sptr source = inputWS->getInstrument()->getSource();
-    IComponent_const_sptr sample = inputWS->getInstrument()->getSample();
     std::vector<double> emptyVector;
-    const double l1 = source->getDistance(*sample);
+    const double l1 = spectrumInfo.l1();
     const std::string emodeStr = getProperty("EMode");
     int emode = 0;
     if (emodeStr == "Direct")
@@ -96,7 +95,6 @@ void ConvertSpectrumAxis::exec() {
       emode = 2;
     const double delta = 0.0;
     double efixed;
-    auto &spectrumInfo = inputWS->spectrumInfo();
     for (size_t i = 0; i < nHist; i++) {
       std::vector<double> xval{inputWS->x(i).front(), inputWS->x(i).back()};
       double twoTheta, l1val, l2;
diff --git a/Framework/Algorithms/src/ConvertSpectrumAxis2.cpp b/Framework/Algorithms/src/ConvertSpectrumAxis2.cpp
index 9013c790aee1cc466633ad81b74c7270334cc9e4..c7db211be17a92721feecc7157b2d7b6ab6c3c34 100644
--- a/Framework/Algorithms/src/ConvertSpectrumAxis2.cpp
+++ b/Framework/Algorithms/src/ConvertSpectrumAxis2.cpp
@@ -1,4 +1,6 @@
 #include "MantidAlgorithms/ConvertSpectrumAxis2.h"
+#include "MantidTypes/SpectrumDefinition.h"
+#include "MantidAPI/DetectorInfo.h"
 #include "MantidAPI/InstrumentValidator.h"
 #include "MantidAPI/NumericAxis.h"
 #include "MantidAPI/Run.h"
@@ -79,9 +81,9 @@ void ConvertSpectrumAxis2::exec() {
   // Call the functions to convert to the different forms of theta or Q.
   if (unitTarget == "theta" || unitTarget == "Theta" ||
       unitTarget == "signed_theta" || unitTarget == "SignedTheta") {
-    createThetaMap(progress, unitTarget, inputWS, nHist);
+    createThetaMap(progress, unitTarget, inputWS);
   } else if (unitTarget == "ElasticQ" || unitTarget == "ElasticQSquared") {
-    createElasticQMap(progress, unitTarget, inputWS, nHist);
+    createElasticQMap(progress, unitTarget, inputWS);
   }
 
   // Create an output workspace and set the property for it.
@@ -94,12 +96,10 @@ void ConvertSpectrumAxis2::exec() {
 * @param progress :: Progress indicator
 * @param targetUnit :: Target conversion unit
 * @param inputWS :: Input Workspace
-* @param nHist :: Stores the number of histograms
 */
 void ConvertSpectrumAxis2::createThetaMap(API::Progress &progress,
                                           const std::string &targetUnit,
-                                          API::MatrixWorkspace_sptr &inputWS,
-                                          size_t nHist) {
+                                          API::MatrixWorkspace_sptr &inputWS) {
   // Not sure about default, previously there was a call to a null function?
   bool signedTheta = false;
   if (targetUnit.compare("signed_theta") == 0 ||
@@ -112,7 +112,7 @@ void ConvertSpectrumAxis2::createThetaMap(API::Progress &progress,
   bool warningGiven = false;
 
   const auto &spectrumInfo = inputWS->spectrumInfo();
-  for (size_t i = 0; i < nHist; ++i) {
+  for (size_t i = 0; i < spectrumInfo.size(); ++i) {
     if (!spectrumInfo.hasDetectors(i)) {
       if (!warningGiven)
         g_log.warning("The instrument definition is incomplete - spectra "
@@ -137,14 +137,10 @@ void ConvertSpectrumAxis2::createThetaMap(API::Progress &progress,
 * @param progress :: Progress indicator
 * @param targetUnit :: Target conversion unit
 * @param inputWS :: Input workspace
-* @param nHist :: Stores the number of histograms
 */
-void ConvertSpectrumAxis2::createElasticQMap(API::Progress &progress,
-                                             const std::string &targetUnit,
-                                             API::MatrixWorkspace_sptr &inputWS,
-                                             size_t nHist) {
-  IComponent_const_sptr source = inputWS->getInstrument()->getSource();
-  IComponent_const_sptr sample = inputWS->getInstrument()->getSample();
+void ConvertSpectrumAxis2::createElasticQMap(
+    API::Progress &progress, const std::string &targetUnit,
+    API::MatrixWorkspace_sptr &inputWS) {
 
   const std::string emodeStr = getProperty("EMode");
   int emode = 0;
@@ -153,13 +149,24 @@ void ConvertSpectrumAxis2::createElasticQMap(API::Progress &progress,
   else if (emodeStr == "Indirect")
     emode = 2;
 
-  auto &spectrumInfo = inputWS->spectrumInfo();
+  const auto &spectrumInfo = inputWS->spectrumInfo();
+  const auto &detectorInfo = inputWS->detectorInfo();
+  const size_t nHist = spectrumInfo.size();
   for (size_t i = 0; i < nHist; i++) {
     double theta(0.0), efixed(0.0);
     if (!spectrumInfo.isMonitor(i)) {
       theta = 0.5 * spectrumInfo.twoTheta(i);
-      efixed =
-          getEfixed(spectrumInfo.detector(i), inputWS, emode); // get efixed
+      /*
+       * Two assumptions made in the following code.
+       * 1. Getting the detector index of the first detector in the spectrum
+       * definition is enough (this should be completely safe).
+       * 2. That the time index is not important (first element of pair only
+       * accessed). i.e we are not performing scanning. Step scanning is not
+       * supported at the time of writing.
+       */
+      const auto detectorIndex = spectrumInfo.spectrumDefinition(i)[0].first;
+      efixed = getEfixed(detectorIndex, detectorInfo, *inputWS,
+                         emode); // get efixed
     } else {
       theta = 0.0;
       efixed = DBL_MIN;
@@ -232,39 +239,38 @@ MatrixWorkspace_sptr ConvertSpectrumAxis2::createOutputWorkspace(
   return outputWorkspace;
 }
 
-double
-ConvertSpectrumAxis2::getEfixed(const Mantid::Geometry::IDetector &detector,
-                                MatrixWorkspace_const_sptr inputWS,
-                                int emode) const {
+double ConvertSpectrumAxis2::getEfixed(
+    const size_t detectorIndex, const API::DetectorInfo &detectorInfo,
+    const Mantid::API::MatrixWorkspace &inputWS, const int emode) const {
   double efixed(0);
   double efixedProp = getProperty("Efixed");
+  Mantid::detid_t detectorID = detectorInfo.detectorIDs()[detectorIndex];
   if (efixedProp != EMPTY_DBL()) {
     efixed = efixedProp;
-    g_log.debug() << "Detector: " << detector.getID() << " Efixed: " << efixed
+    g_log.debug() << "Detector: " << detectorID << " Efixed: " << efixed
                   << "\n";
   } else {
     if (emode == 1) {
-      if (inputWS->run().hasProperty("Ei")) {
-        efixed = inputWS->run().getLogAsSingleValue("Ei");
+      if (inputWS.run().hasProperty("Ei")) {
+        efixed = inputWS.run().getLogAsSingleValue("Ei");
       } else {
         throw std::invalid_argument("Could not retrieve Efixed from the "
                                     "workspace. Please provide a value.");
       }
     } else if (emode == 2) {
-      std::vector<double> efixedVec = detector.getNumberParameter("Efixed");
-      if (efixedVec.empty()) {
-        int detid = detector.getID();
-        IDetector_const_sptr detectorSingle =
-            inputWS->getInstrument()->getDetector(detid);
-        efixedVec = detectorSingle->getNumberParameter("Efixed");
-      }
+
+      const auto &detectorSingle = detectorInfo.detector(detectorIndex);
+
+      std::vector<double> efixedVec =
+          detectorSingle.getNumberParameter("Efixed");
+
       if (!efixedVec.empty()) {
         efixed = efixedVec.at(0);
-        g_log.debug() << "Detector: " << detector.getID()
-                      << " EFixed: " << efixed << "\n";
+        g_log.debug() << "Detector: " << detectorID << " EFixed: " << efixed
+                      << "\n";
       } else {
         g_log.warning() << "Efixed could not be found for detector "
-                        << detector.getID() << ", please provide a value\n";
+                        << detectorID << ", please provide a value\n";
         throw std::invalid_argument("Could not retrieve Efixed from the "
                                     "detector. Please provide a value.");
       }
diff --git a/Framework/Algorithms/src/ConvertUnitsUsingDetectorTable.cpp b/Framework/Algorithms/src/ConvertUnitsUsingDetectorTable.cpp
index 4eda0c21ddb3b1092072d94dbc2c9f265fe59cc8..47eb7cd854309fea47857e811bb93c619f2813df 100644
--- a/Framework/Algorithms/src/ConvertUnitsUsingDetectorTable.cpp
+++ b/Framework/Algorithms/src/ConvertUnitsUsingDetectorTable.cpp
@@ -2,9 +2,10 @@
 
 #include "MantidDataObjects/EventWorkspace.h"
 #include "MantidDataObjects/TableWorkspace.h"
-#include "MantidAPI/WorkspaceUnitValidator.h"
+#include "MantidAPI/ISpectrum.h"
 #include "MantidAPI/HistogramValidator.h"
 #include "MantidAPI/SpectrumInfo.h"
+#include "MantidAPI/WorkspaceUnitValidator.h"
 #include "MantidGeometry/IDetector.h"
 #include "MantidKernel/CompositeValidator.h"
 #include "MantidKernel/ListValidator.h"
@@ -147,7 +148,7 @@ MatrixWorkspace_sptr ConvertUnitsUsingDetectorTable::convertViaTOF(
 
   // Perform Sanity Validation before creating workspace
   size_t checkIndex = 0;
-  int checkSpecNo = inputWS->getDetector(checkIndex)->getID();
+  int checkSpecNo = inputWS->getSpectrum(checkIndex).getSpectrumNo();
   auto checkSpecIter =
       std::find(spectraColumn.begin(), spectraColumn.end(), checkSpecNo);
   if (checkSpecIter != spectraColumn.end()) {
diff --git a/Framework/Algorithms/src/CreateLogTimeCorrection.cpp b/Framework/Algorithms/src/CreateLogTimeCorrection.cpp
index 0f949c3e9ba18f133067403b91a17ca8cf8dfe4b..d02904b62e553732a50cc479e2683d9241ff051b 100644
--- a/Framework/Algorithms/src/CreateLogTimeCorrection.cpp
+++ b/Framework/Algorithms/src/CreateLogTimeCorrection.cpp
@@ -1,8 +1,10 @@
 #include "MantidAlgorithms/CreateLogTimeCorrection.h"
+#include "MantidAPI/DetectorInfo.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/InstrumentValidator.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/Run.h"
+#include "MantidAPI/DetectorInfo.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidAPI/WorkspaceProperty.h"
 
@@ -44,12 +46,11 @@ void CreateLogTimeCorrection::init() {
   */
 void CreateLogTimeCorrection::exec() {
   // 1. Process input
-  m_dataWS = getProperty("InputWorkspace");
-  m_instrument = m_dataWS->getInstrument();
+  MatrixWorkspace_sptr dataWS = getProperty("InputWorkspace");
 
   //   Check whether the output workspace name is same as input
   string outwsname = getPropertyValue("OutputWorkspace");
-  if (outwsname.compare(m_dataWS->getName()) == 0) {
+  if (outwsname.compare(dataWS->getName()) == 0) {
     stringstream errmsg;
     errmsg << "It is not allowed to use the same name by both input matrix "
               "workspace and output table workspace.";
@@ -57,55 +58,37 @@ void CreateLogTimeCorrection::exec() {
     throw runtime_error(errmsg.str());
   }
 
-  // 2. Explore geometry
-  getInstrumentSetup();
+  const auto &detectorInfo = dataWS->detectorInfo();
+
+  // 2. Log some information
+  logGeometryInformation(detectorInfo);
 
   // 3. Calculate log time correction
-  calculateCorrection();
+  auto corrections = calculateCorrections(detectorInfo);
 
   // 4. Output
-  TableWorkspace_sptr outWS = generateCorrectionTable();
+  TableWorkspace_sptr outWS =
+      generateCorrectionTable(detectorInfo, corrections);
   setProperty("OutputWorkspace", outWS);
 
   string filename = getProperty("OutputFilename");
   g_log.information() << "Output file name is " << filename << ".\n";
   if (!filename.empty()) {
-    writeCorrectionToFile(filename);
+    writeCorrectionToFile(filename, detectorInfo, corrections);
   }
 }
 
 //----------------------------------------------------------------------------------------------
 /** Get instrument geometry setup including L2 for each detector and L1
   */
-void CreateLogTimeCorrection::getInstrumentSetup() {
-  // 1. Get sample position and source position
-  IComponent_const_sptr sample = m_instrument->getSample();
-  if (!sample) {
-    throw runtime_error("No sample has been set.");
-  }
-  V3D samplepos = sample->getPos();
-
-  IComponent_const_sptr source = m_instrument->getSource();
-  if (!source) {
-    throw runtime_error("No source has been set.");
-  }
-  V3D sourcepos = source->getPos();
-  m_L1 = sourcepos.distance(samplepos);
-
-  // 2. Get detector IDs
-  std::vector<detid_t> detids = m_instrument->getDetectorIDs(true);
-  for (auto &detid : detids) {
-    IDetector_const_sptr detector = m_instrument->getDetector(detid);
-    V3D detpos = detector->getPos();
-    double l2 = detpos.distance(samplepos);
-    m_l2map.emplace(detid, l2);
-  }
+void CreateLogTimeCorrection::logGeometryInformation(
+    const API::DetectorInfo &detectorInfo) const {
 
-  // 3. Output information
-  g_log.information() << "Sample position = " << samplepos << "; "
-                      << "Source position = " << sourcepos << ", L1 = " << m_L1
+  g_log.information() << "Sample position = " << detectorInfo.samplePosition()
                       << "; "
-                      << "Number of detector/pixels = " << detids.size()
+                      << "Source position = " << detectorInfo.sourcePosition()
+                      << ", L1 = " << detectorInfo.l1() << "; "
+                      << "Number of detector/pixels = " << detectorInfo.size()
                       << ".\n";
 }
 
@@ -114,61 +97,67 @@ void CreateLogTimeCorrection::getInstrumentSetup() {
  * time at detector
   * to time at sample
   */
-void CreateLogTimeCorrection::calculateCorrection() {
-  map<int, double>::iterator miter;
-  for (miter = m_l2map.begin(); miter != m_l2map.end(); ++miter) {
-    int detid = miter->first;
-    double l2 = miter->second;
-    double corrfactor = m_L1 / (m_L1 + l2);
-    m_correctionMap.emplace(detid, corrfactor);
+std::vector<double> CreateLogTimeCorrection::calculateCorrections(
+    const API::DetectorInfo &detectorInfo) const {
+
+  std::vector<double> corrections(detectorInfo.size());
+  const double l1 = detectorInfo.l1();
+  for (size_t detectorIndex = 0; detectorIndex < detectorInfo.size();
+       ++detectorIndex) {
+
+    double corrfactor = l1 / (l1 + detectorInfo.l2(detectorIndex));
+    corrections[detectorIndex] = corrfactor;
   }
+  return corrections;
 }
 
 //----------------------------------------------------------------------------------------------
 /** Write L2 map and correction map to a TableWorkspace
   */
-TableWorkspace_sptr CreateLogTimeCorrection::generateCorrectionTable() {
+TableWorkspace_sptr CreateLogTimeCorrection::generateCorrectionTable(
+    const API::DetectorInfo &detectorInfo,
+    const std::vector<double> &corrections) const {
   auto tablews = boost::make_shared<TableWorkspace>();
 
   tablews->addColumn("int", "DetectorID");
   tablews->addColumn("double", "Correction");
   tablews->addColumn("double", "L2");
 
-  if (m_l2map.size() != m_correctionMap.size())
-    throw runtime_error("Program logic error!");
+  const auto &detectorIds = detectorInfo.detectorIDs();
 
-  map<int, double>::iterator l2iter, citer;
-  for (l2iter = m_l2map.begin(); l2iter != m_l2map.end(); ++l2iter) {
-    int detid = l2iter->first;
-    double l2 = l2iter->second;
+  for (size_t detectorIndex = 0; detectorIndex < detectorInfo.size();
+       ++detectorIndex) {
 
-    citer = m_correctionMap.find(detid);
-    if (citer == m_correctionMap.end()) {
-      throw runtime_error("Program logic error (B)!");
-    }
-    double correction = citer->second;
+    if (!detectorInfo.isMonitor(detectorIndex)) {
+      const detid_t detid = detectorIds[detectorIndex];
+      const double correction = corrections[detectorIndex];
+      const double l2 = detectorInfo.l2(detectorIndex);
 
-    TableRow newrow = tablews->appendRow();
-    newrow << detid << correction << l2;
+      TableRow newrow = tablews->appendRow();
+      newrow << detid << correction << l2;
+    }
   }
 
   return tablews;
 }
-
 //----------------------------------------------------------------------------------------------
 /** Write correction map to a text file
   */
-void CreateLogTimeCorrection::writeCorrectionToFile(string filename) {
+void CreateLogTimeCorrection::writeCorrectionToFile(
+    const string filename, const DetectorInfo &detectorInfo,
+    const std::vector<double> &corrections) const {
   ofstream ofile;
   ofile.open(filename.c_str());
 
   if (ofile.is_open()) {
-    map<int, double>::iterator miter;
-    for (miter = m_correctionMap.begin(); miter != m_correctionMap.end();
-         ++miter) {
-      int detid = miter->first;
-      double corr = miter->second;
-      ofile << detid << "\t" << setw(20) << setprecision(5) << corr << "\n";
+
+    const auto &detectorIds = detectorInfo.detectorIDs();
+    for (size_t detectorIndex = 0; detectorIndex < corrections.size();
+         ++detectorIndex) {
+      if (!detectorInfo.isMonitor(detectorIndex)) {
+        ofile << detectorIds[detectorIndex] << "\t" << setw(20)
+              << setprecision(5) << corrections[detectorIndex] << "\n";
+      }
     }
     ofile.close();
   } else {
diff --git a/Framework/Algorithms/src/DetectorDiagnostic.cpp b/Framework/Algorithms/src/DetectorDiagnostic.cpp
index 7b1ea1099f6a9540a272c204363d5b64748246b5..46d7be85448382488b7f206c885cadab4cef8571 100644
--- a/Framework/Algorithms/src/DetectorDiagnostic.cpp
+++ b/Framework/Algorithms/src/DetectorDiagnostic.cpp
@@ -559,9 +559,11 @@ DetectorDiagnostic::makeMap(API::MatrixWorkspace_sptr countsWS) {
                              "detector to spectra map. Try with LevelUp=0.");
   }
 
-  for (size_t i = 0; i < countsWS->getNumberHistograms(); i++) {
-    detid_t d = (*(countsWS->getSpectrum(i).getDetectorIDs().begin()));
-    auto anc = instrument->getDetector(d)->getAncestors();
+  const SpectrumInfo &spectrumInfo = countsWS->spectrumInfo();
+
+  for (size_t i = 0; i < countsWS->getNumberHistograms(); ++i) {
+
+    auto anc = spectrumInfo.detector(i).getAncestors();
     if (anc.size() < static_cast<size_t>(m_parents)) {
       g_log.warning("Too many levels up. Will ignore LevelsUp");
       m_parents = 0;
diff --git a/Framework/Algorithms/src/FilterEvents.cpp b/Framework/Algorithms/src/FilterEvents.cpp
index 5607b3e7eded4095d2d1858852aad7ca0f588a17..049be90c0c6efd8c7d5e89d6462c46a1bdd50a57 100644
--- a/Framework/Algorithms/src/FilterEvents.cpp
+++ b/Framework/Algorithms/src/FilterEvents.cpp
@@ -529,7 +529,11 @@ void FilterEvents::createOutputWorkspaces() {
     if (add2output) {
       // Generate output property name
       std::stringstream propertynamess;
-      propertynamess << "OutputWorkspace_" << wsgroup;
+      if (wsgroup == -1) {
+        propertynamess << "OutputWorkspace_unfiltered";
+      } else {
+        propertynamess << "OutputWorkspace_" << wsgroup;
+      }
 
       // Inserted this pair to map
       m_wsNames.push_back(wsname.str());
diff --git a/Framework/Algorithms/src/RemoveLowResTOF.cpp b/Framework/Algorithms/src/RemoveLowResTOF.cpp
index 074d91b3cee3ba8af03f0398510886153a2a4f65..93e4db634a752cdb365b9439b1660e90b2605168 100644
--- a/Framework/Algorithms/src/RemoveLowResTOF.cpp
+++ b/Framework/Algorithms/src/RemoveLowResTOF.cpp
@@ -245,11 +245,8 @@ void RemoveLowResTOF::execEvent(const SpectrumInfo &spectrumInfo) {
 
 double RemoveLowResTOF::calcTofMin(const std::size_t workspaceIndex,
                                    const SpectrumInfo &spectrumInfo) {
-  const Kernel::V3D &sourcePos = spectrumInfo.sourcePosition();
-  const Kernel::V3D &samplePos = spectrumInfo.samplePosition();
-  const Kernel::V3D &beamline = samplePos - sourcePos;
+
   const double l1 = spectrumInfo.l1();
-  double beamline_norm = 2. * l1;
 
   // Get a vector of detector IDs
   std::vector<detid_t> detNumbers;
@@ -260,9 +257,9 @@ double RemoveLowResTOF::calcTofMin(const std::size_t workspaceIndex,
   if (isEmpty(m_wavelengthMin)) {
     std::map<detid_t, double> offsets; // just an empty offsets map
     Geometry::Instrument_const_sptr instrument = m_inputWS->getInstrument();
-    double dspmap =
-        Instrument::calcConversion(l1, beamline, beamline_norm, samplePos,
-                                   instrument, detNumbers, offsets);
+    double dspmap = Conversion::tofToDSpacingFactor(
+        l1, spectrumInfo.l2(workspaceIndex),
+        spectrumInfo.twoTheta(workspaceIndex), detNumbers, offsets);
 
     // this is related to the reference tof
     double sqrtdmin =
diff --git a/Framework/Algorithms/test/BinaryOperationTest.h b/Framework/Algorithms/test/BinaryOperationTest.h
index 826d443dc14f0f9b6a5e2fab9d00a50db977665e..10f767a5d1ea499c3b3f5028e0ccb49d040dce45 100644
--- a/Framework/Algorithms/test/BinaryOperationTest.h
+++ b/Framework/Algorithms/test/BinaryOperationTest.h
@@ -69,17 +69,17 @@ public:
   void testcheckSizeCompatibility1D1D() {
     // Register the workspace in the data service
     Workspace2D_sptr work_in1 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(10);
+        WorkspaceCreationHelper::create1DWorkspaceFib(10, true);
     Workspace2D_sptr work_in2 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(20);
+        WorkspaceCreationHelper::create1DWorkspaceFib(20, true);
     Workspace2D_sptr work_in3 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(10);
+        WorkspaceCreationHelper::create1DWorkspaceFib(10, true);
     Workspace2D_sptr work_in4 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(5);
+        WorkspaceCreationHelper::create1DWorkspaceFib(5, true);
     Workspace2D_sptr work_in5 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(3);
+        WorkspaceCreationHelper::create1DWorkspaceFib(3, true);
     Workspace2D_sptr work_in6 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(1);
+        WorkspaceCreationHelper::create1DWorkspaceFib(1, true);
     BinaryOpHelper helper;
     TS_ASSERT(!helper.checkSizeCompatibility(work_in1, work_in2).empty());
     TS_ASSERT(helper.checkSizeCompatibility(work_in1, work_in3).empty());
@@ -90,18 +90,19 @@ public:
 
   void testcheckSizeCompatibility2D1D() {
     // Register the workspace in the data service
+    const bool isHistogram(true);
     Workspace2D_sptr work_in1 =
-        WorkspaceCreationHelper::create2DWorkspace123(10, 10);
+        WorkspaceCreationHelper::create2DWorkspace123(10, 10, isHistogram);
     Workspace2D_sptr work_in2 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(20);
+        WorkspaceCreationHelper::create1DWorkspaceFib(20, true);
     Workspace2D_sptr work_in3 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(10);
+        WorkspaceCreationHelper::create1DWorkspaceFib(10, true);
     Workspace2D_sptr work_in4 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(5);
+        WorkspaceCreationHelper::create1DWorkspaceFib(5, true);
     Workspace2D_sptr work_in5 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(3);
+        WorkspaceCreationHelper::create1DWorkspaceFib(3, true);
     Workspace2D_sptr work_in6 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(1);
+        WorkspaceCreationHelper::create1DWorkspaceFib(1, true);
     MatrixWorkspace_sptr work_inEvent1 =
         WorkspaceCreationHelper::createEventWorkspace(10, 1);
     // will not pass x array does not match
diff --git a/Framework/Algorithms/test/CheckWorkspacesMatchTest.h b/Framework/Algorithms/test/CheckWorkspacesMatchTest.h
index 13c1715feb4192e1cdf1fca04bf88aa73f798ce8..96c0870f6556f57456aed635caed871a3adc4fef 100644
--- a/Framework/Algorithms/test/CheckWorkspacesMatchTest.h
+++ b/Framework/Algorithms/test/CheckWorkspacesMatchTest.h
@@ -543,7 +543,7 @@ public:
       checker.initialize();
 
     Mantid::API::MatrixWorkspace_sptr ws2 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(2);
+        WorkspaceCreationHelper::create1DWorkspaceFib(2, true);
 
     TS_ASSERT_THROWS_NOTHING(checker.setProperty("Workspace1", ws1));
     TS_ASSERT_THROWS_NOTHING(checker.setProperty("Workspace2", ws2));
diff --git a/Framework/Algorithms/test/CommutativeBinaryOperationTest.h b/Framework/Algorithms/test/CommutativeBinaryOperationTest.h
index d0321893aa53fc1f45493f4c8d5de064763deeb2..701de5e836500fab723ce405afb50f720bb4e4a7 100644
--- a/Framework/Algorithms/test/CommutativeBinaryOperationTest.h
+++ b/Framework/Algorithms/test/CommutativeBinaryOperationTest.h
@@ -26,7 +26,7 @@ public:
   int version() const override { return 1; }
   /// Algorithm's summary for identification overriding a virtual method
   const std::string summary() const override {
-    return "Sommutative binary operation helper.";
+    return "Commutative binary operation helper.";
   }
 
   std::string checkSizeCompatibility(const MatrixWorkspace_const_sptr ws1,
@@ -72,17 +72,17 @@ public:
   void testcheckSizeCompatibility1D1D() {
     // Register the workspace in the data service
     MatrixWorkspace_sptr work_in1 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(10);
+        WorkspaceCreationHelper::create1DWorkspaceFib(10, true);
     MatrixWorkspace_sptr work_in2 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(20);
+        WorkspaceCreationHelper::create1DWorkspaceFib(20, true);
     MatrixWorkspace_sptr work_in3 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(10);
+        WorkspaceCreationHelper::create1DWorkspaceFib(10, true);
     MatrixWorkspace_sptr work_in4 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(5);
+        WorkspaceCreationHelper::create1DWorkspaceFib(5, true);
     MatrixWorkspace_sptr work_in5 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(3);
+        WorkspaceCreationHelper::create1DWorkspaceFib(3, true);
     MatrixWorkspace_sptr work_in6 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(1);
+        WorkspaceCreationHelper::create1DWorkspaceFib(1, true);
     CommutativeBinaryOpHelper helper;
     TS_ASSERT(!helper.checkSizeCompatibility(work_in1, work_in2).empty());
     TS_ASSERT(helper.checkSizeCompatibility(work_in1, work_in3).empty());
@@ -94,17 +94,17 @@ public:
   void testcheckSizeCompatibility2D1D() {
     // Register the workspace in the data service
     MatrixWorkspace_sptr work_in1 =
-        WorkspaceCreationHelper::create2DWorkspace123(10, 10);
+        WorkspaceCreationHelper::create2DWorkspace123(10, 10, true);
     MatrixWorkspace_sptr work_in2 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(20);
+        WorkspaceCreationHelper::create1DWorkspaceFib(20, true);
     MatrixWorkspace_sptr work_in3 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(10);
+        WorkspaceCreationHelper::create1DWorkspaceFib(10, true);
     MatrixWorkspace_sptr work_in4 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(5);
+        WorkspaceCreationHelper::create1DWorkspaceFib(5, true);
     MatrixWorkspace_sptr work_in5 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(3);
+        WorkspaceCreationHelper::create1DWorkspaceFib(3, true);
     MatrixWorkspace_sptr work_in6 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(1);
+        WorkspaceCreationHelper::create1DWorkspaceFib(1, true);
     MatrixWorkspace_sptr work_event1 =
         WorkspaceCreationHelper::createEventWorkspace(10, 1);
     MatrixWorkspace_sptr work_event2 =
diff --git a/Framework/Algorithms/test/CompareWorkspacesTest.h b/Framework/Algorithms/test/CompareWorkspacesTest.h
index 9ef855e597fa2e0033fd191ad691bdc003c24cfb..4023100086f6c84277db6026d8e52cced820b928 100644
--- a/Framework/Algorithms/test/CompareWorkspacesTest.h
+++ b/Framework/Algorithms/test/CompareWorkspacesTest.h
@@ -521,7 +521,7 @@ public:
       checker.initialize();
 
     Mantid::API::MatrixWorkspace_sptr ws2 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(2);
+        WorkspaceCreationHelper::create1DWorkspaceFib(2, true);
 
     TS_ASSERT_THROWS_NOTHING(checker.setProperty("Workspace1", ws1));
     TS_ASSERT_THROWS_NOTHING(checker.setProperty("Workspace2", ws2));
diff --git a/Framework/Algorithms/test/ConvertSpectrumAxisTest.h b/Framework/Algorithms/test/ConvertSpectrumAxisTest.h
index d117c0394f8a7c00c0c5a65c305dc9c381a269f5..da6d9f9970a453726509a64a1ad7f44e86f22435 100644
--- a/Framework/Algorithms/test/ConvertSpectrumAxisTest.h
+++ b/Framework/Algorithms/test/ConvertSpectrumAxisTest.h
@@ -168,4 +168,40 @@ public:
   }
 };
 
+class ConvertSpectrumAxisTestPerformance : public CxxTest::TestSuite {
+private:
+  Workspace_sptr m_inputWorkspace;
+
+public:
+  static ConvertSpectrumAxisTestPerformance *createSuite() {
+    return new ConvertSpectrumAxisTestPerformance();
+  }
+  static void destroySuite(ConvertSpectrumAxisTestPerformance *suite) {
+    delete suite;
+  }
+
+  ConvertSpectrumAxisTestPerformance() {
+    Mantid::DataHandling::LoadRaw3 loader;
+    loader.setChild(true);
+    loader.initialize();
+    loader.setPropertyValue("Filename", "LOQ48127.raw");
+    loader.setPropertyValue("OutputWorkspace", "dummy");
+    loader.execute();
+    m_inputWorkspace = loader.getProperty("OutputWorkspace");
+  }
+  void test_exec_performance() {
+
+    Mantid::Algorithms::ConvertSpectrumAxis alg;
+    alg.setChild(true);
+    alg.initialize();
+    alg.setProperty("InputWorkspace", m_inputWorkspace);
+    alg.setProperty("Target", "theta");
+    alg.setPropertyValue("OutputWorkspace", "dummy");
+    for (int i = 0; i < 1000; ++i) {
+      alg.execute();
+    }
+    MatrixWorkspace_sptr out = alg.getProperty("OutputWorkspace");
+  }
+};
+
 #endif /*CONVERTSPECTRUMAXISTEST_H_*/
diff --git a/Framework/Algorithms/test/ExponentialTest.h b/Framework/Algorithms/test/ExponentialTest.h
index 5acc38d4a239ee1a02683f9367c06acf9f76cfa4..b02011169e799971e959eea91251ef9cb0403274 100644
--- a/Framework/Algorithms/test/ExponentialTest.h
+++ b/Framework/Algorithms/test/ExponentialTest.h
@@ -30,7 +30,7 @@ public:
     int sizex = 10;
     // Register the workspace in the data service
     MatrixWorkspace_sptr work_in1 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(sizex);
+        WorkspaceCreationHelper::create1DWorkspaceFib(sizex, true);
 
     AnalysisDataService::Instance().add("test_in11", work_in1);
     setError(work_in1);
diff --git a/Framework/Algorithms/test/LogarithmTest.h b/Framework/Algorithms/test/LogarithmTest.h
index 9d58b03c18054f60602997773bfbac379125659e..0790f5fa3826bba1fabec430b37b5e88f50e11c2 100644
--- a/Framework/Algorithms/test/LogarithmTest.h
+++ b/Framework/Algorithms/test/LogarithmTest.h
@@ -30,7 +30,7 @@ public:
 
     // Register the workspace in the data service
     MatrixWorkspace_sptr work_in1 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(sizex);
+        WorkspaceCreationHelper::create1DWorkspaceFib(sizex, true);
     AnalysisDataService::Instance().add("test_inLn", work_in1);
 
     Logarithm alg;
diff --git a/Framework/Algorithms/test/MultiplyDivideTest.in.h b/Framework/Algorithms/test/MultiplyDivideTest.in.h
index c185ea41dc7bcc1c77db57916a46401142609f55..07d568d5b733b98f57e656ba23b450068954ff29 100644
--- a/Framework/Algorithms/test/MultiplyDivideTest.in.h
+++ b/Framework/Algorithms/test/MultiplyDivideTest.in.h
@@ -43,9 +43,9 @@ public:
   {
     DO_DIVIDE = @MULTIPLYDIVIDETEST_DO_DIVIDE@;
 
-    fibWS1d = WorkspaceCreationHelper::create1DWorkspaceFib(5);
-    histWS_5x10_123 = WorkspaceCreationHelper::create2DWorkspace123(5,10);
-    histWS_5x10_154 = WorkspaceCreationHelper::create2DWorkspace154(5,10);
+    fibWS1d = WorkspaceCreationHelper::create1DWorkspaceFib(5, true);
+    histWS_5x10_123 = WorkspaceCreationHelper::create2DWorkspace123(5,10, true);
+    histWS_5x10_154 = WorkspaceCreationHelper::create2DWorkspace154(5,10, true);
     histWS_5x10_bin = WorkspaceCreationHelper::create2DWorkspace(5,10);
     eventWS_5x10_50 = WorkspaceCreationHelper::createEventWorkspace(5,10,50,0.0,1.0,2);
   }
@@ -167,15 +167,16 @@ public:
   void test_1D_Rand2D()
   {
     int nHist = 5,nBins=5;
-    MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::create2DWorkspace154(nHist,nBins);
-    MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::create1DWorkspaceRand(nBins);
+    const bool isHistogram(true);
+    MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::create2DWorkspace154(nHist,nBins, isHistogram);
+    MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::create1DWorkspaceRand(nBins, isHistogram);
     performTest(work_in1,work_in2);
   }
 
   void test_2D_1DVertical()
   {
     MatrixWorkspace_sptr work_in1 = histWS_5x10_154;
-    MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::create2DWorkspace123(1,10);
+    MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::create2DWorkspace123(1,10, true);
     performTest(work_in1,work_in2);
   }
 
@@ -183,8 +184,8 @@ public:
   {
     //In 2D workspaces, the X bins have to match
     int nHist = 20,nBins=10;
-    MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::create2DWorkspace123(nHist,nBins);
-    MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::create2DWorkspace154(1,nBins*5);
+    MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::create2DWorkspace123(nHist,nBins, true);
+    MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::create2DWorkspace154(1,nBins*5, true);
     performTest_fails(work_in1, work_in2);
   }
 
@@ -728,6 +729,7 @@ public:
     alg->setPropertyValue("RHSWorkspace",wsName2);
     alg->setPropertyValue("OutputWorkspace",wsNameOut);
     alg->setProperty("AllowDifferentNumberSpectra", allowMismatchedSpectra);
+    alg->setRethrows(true);
     TSM_ASSERT_THROWS_NOTHING(message, alg->execute());
     TSM_ASSERT( message, alg->isExecuted() );
     MatrixWorkspace_sptr work_out1;
diff --git a/Framework/Algorithms/test/PlusMinusTest.in.h b/Framework/Algorithms/test/PlusMinusTest.in.h
index 2f7391d33ff1c93a12279564a388d35400de4391..102dd692e0ea6c9ce28ade56298368a9e0b8e898 100644
--- a/Framework/Algorithms/test/PlusMinusTest.in.h
+++ b/Framework/Algorithms/test/PlusMinusTest.in.h
@@ -43,9 +43,9 @@ public:
     wsNameOut = "MinusTest_outputWorkspace";
     DO_PLUS = @PLUSMINUSTEST_DO_PLUS@;
 
-    fibWS1d = WorkspaceCreationHelper::create1DWorkspaceFib(5);
-    histWS_5x10_123 = WorkspaceCreationHelper::create2DWorkspace123(5,10);
-    histWS_5x10_154 = WorkspaceCreationHelper::create2DWorkspace154(5,10);
+    fibWS1d = WorkspaceCreationHelper::create1DWorkspaceFib(5, true);
+    histWS_5x10_123 = WorkspaceCreationHelper::create2DWorkspace123(5,10, true);
+    histWS_5x10_154 = WorkspaceCreationHelper::create2DWorkspace154(5,10, true);
     histWS_5x10_bin = WorkspaceCreationHelper::create2DWorkspace(5,10);
     eventWS_5x10_50 = WorkspaceCreationHelper::createEventWorkspace(5,10,50,0.0,1.0,2);
     eventWS_small = WorkspaceCreationHelper::createEventWorkspace(numPixels, numBins, numBins, 0.0, 1.0, 2);
@@ -167,7 +167,7 @@ public:
   {
     int nBins = 5;
     MatrixWorkspace_sptr work_in1 = fibWS1d;
-    MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::create1DWorkspaceRand(nBins);
+    MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::create1DWorkspaceRand(nBins, true);
     performTest(work_in1,work_in2);
   }
 
@@ -206,8 +206,9 @@ public:
   void test_1D_Rand2D()
   {
     int nHist = 5,nBins=5;
-    MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::create2DWorkspace154(nHist,nBins);
-    MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::create1DWorkspaceRand(nBins);
+    const bool isHistogram(true);
+    MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::create2DWorkspace154(nHist,nBins, isHistogram);
+    MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::create1DWorkspaceRand(nBins, isHistogram);
     performTest(work_in1,work_in2);
   }
 
@@ -215,14 +216,14 @@ public:
   {
     int nBins=10;
     MatrixWorkspace_sptr work_in1 = histWS_5x10_154;
-    MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::create2DWorkspace123(1,nBins);
+    MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::create2DWorkspace123(1,nBins, true);
     performTest(work_in1,work_in2);
   }
 
   void test_1DVertical_2D()
   {
     int nBins=10;
-    MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::create2DWorkspace123(1,nBins);
+    MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::create2DWorkspace123(1,nBins, true);
     MatrixWorkspace_sptr work_in2 = histWS_5x10_154;
     if (DO_PLUS)
     {
@@ -238,7 +239,7 @@ public:
   {
     //In 2D workspaces, the X bins have to match
     int nHist = 10,nBins=5;
-    MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::create2DWorkspace123(nHist,nBins);
+    MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::create2DWorkspace123(nHist,nBins, true);
     MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::create2DWorkspace154(1,nBins*5);
     performTest_fails(work_in1, work_in2);
   }
@@ -703,6 +704,7 @@ public:
     alg->setPropertyValue("RHSWorkspace",wsName2);
     alg->setPropertyValue("OutputWorkspace",wsNameOut);
     alg->setProperty("AllowDifferentNumberSpectra", allowMismatchedSpectra);
+    alg->setRethrows(true);
     TSM_ASSERT_THROWS_NOTHING(message, alg->execute());
     TSM_ASSERT( message, alg->isExecuted() );
     MatrixWorkspace_sptr work_out1;
diff --git a/Framework/Algorithms/test/PoissonErrorsTest.h b/Framework/Algorithms/test/PoissonErrorsTest.h
index ddcbd42bb10b6eb56ce0286af31274d554f7062c..743303a7c31beda536c645478c54a4364844c14c 100644
--- a/Framework/Algorithms/test/PoissonErrorsTest.h
+++ b/Framework/Algorithms/test/PoissonErrorsTest.h
@@ -48,9 +48,9 @@ public:
     int nBins = 10;
     // Register the workspace in the data service
     MatrixWorkspace_sptr work_in1 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(nBins);
+        WorkspaceCreationHelper::create1DWorkspaceFib(nBins, true);
     MatrixWorkspace_sptr work_in2 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(nBins);
+        WorkspaceCreationHelper::create1DWorkspaceFib(nBins, true);
     AnalysisDataService::Instance().add("test_in11", work_in1);
     AnalysisDataService::Instance().add("test_in12", work_in2);
 
@@ -78,9 +78,9 @@ public:
     int nBins = 10;
     // Register the workspace in the data service
     MatrixWorkspace_sptr work_in1 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(nBins);
+        WorkspaceCreationHelper::create1DWorkspaceFib(nBins, true);
     MatrixWorkspace_sptr work_in2 =
-        WorkspaceCreationHelper::create1DWorkspaceRand(nBins);
+        WorkspaceCreationHelper::create1DWorkspaceRand(nBins, true);
     AnalysisDataService::Instance().add("test_in11", work_in1);
     AnalysisDataService::Instance().add("test_in12", work_in2);
 
@@ -138,9 +138,9 @@ public:
     int nHist = 10, nBins = 20;
     // Register the workspace in the data service
     MatrixWorkspace_sptr work_in1 =
-        WorkspaceCreationHelper::create2DWorkspace154(nHist, nBins);
+        WorkspaceCreationHelper::create2DWorkspace154(nHist, nBins, true);
     MatrixWorkspace_sptr work_in2 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(nBins);
+        WorkspaceCreationHelper::create1DWorkspaceFib(nBins, true);
 
     PoissonErrors alg;
 
@@ -162,9 +162,9 @@ public:
     int nHist = 10, nBins = 20;
     // Register the workspace in the data service
     MatrixWorkspace_sptr work_in2 =
-        WorkspaceCreationHelper::create1DWorkspaceRand(nBins);
+        WorkspaceCreationHelper::create1DWorkspaceRand(nBins, true);
     MatrixWorkspace_sptr work_in1 =
-        WorkspaceCreationHelper::create2DWorkspace154(nHist, nBins);
+        WorkspaceCreationHelper::create2DWorkspace154(nHist, nBins, true);
 
     PoissonErrors alg;
 
@@ -187,7 +187,7 @@ public:
     // Register the workspace in the data service
 
     MatrixWorkspace_sptr work_in1 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(nBins);
+        WorkspaceCreationHelper::create1DWorkspaceFib(nBins, true);
     MatrixWorkspace_sptr work_in2 =
         WorkspaceCreationHelper::createWorkspaceSingleValue(2.2);
     AnalysisDataService::Instance().add("test_in11", work_in1);
@@ -211,7 +211,7 @@ public:
     int nBins = 300;
     // Register the workspace in the data service
     MatrixWorkspace_sptr work_in1 =
-        WorkspaceCreationHelper::create1DWorkspaceFib(nBins);
+        WorkspaceCreationHelper::create1DWorkspaceFib(nBins, true);
     MatrixWorkspace_sptr work_in2 =
         WorkspaceCreationHelper::createWorkspaceSingleValue(4.455);
 
diff --git a/Framework/Algorithms/test/PolarizationCorrectionTest.h b/Framework/Algorithms/test/PolarizationCorrectionTest.h
index 4c4b2bbf104d7fba0ea5df936813cc37d43b0d0a..921b60eca4059822c7abb40815c407220f47ab63 100644
--- a/Framework/Algorithms/test/PolarizationCorrectionTest.h
+++ b/Framework/Algorithms/test/PolarizationCorrectionTest.h
@@ -137,7 +137,7 @@ public:
 
   MatrixWorkspace_sptr create1DWorkspace(int size, double signal,
                                          double error) {
-    auto ws = create1DWorkspaceConstant(size, signal, error);
+    auto ws = create1DWorkspaceConstant(size, signal, error, true);
     ws->getAxis(0)->setUnit("Wavelength");
     return ws;
   }
diff --git a/Framework/Algorithms/test/SetUncertaintiesTest.h b/Framework/Algorithms/test/SetUncertaintiesTest.h
index 1fb51ce41ce14233ecb82d72c6dafd8c80a8984d..43a74f6e6b514116283b8d74f04f27eaba019cf2 100644
--- a/Framework/Algorithms/test/SetUncertaintiesTest.h
+++ b/Framework/Algorithms/test/SetUncertaintiesTest.h
@@ -25,7 +25,7 @@ public:
   */
   API::MatrixWorkspace_sptr runAlg(const std::string &mode) {
     // random data mostly works
-    auto inWksp = WorkspaceCreationHelper::create1DWorkspaceRand(30);
+    auto inWksp = WorkspaceCreationHelper::create1DWorkspaceRand(30, true);
     // Ensure first elements of random workspace are zero so test don't
     // pass randomly
     auto &E = inWksp->mutableE(0);
@@ -111,7 +111,7 @@ public:
     constexpr size_t wsSize(1000000);
 
     // random data mostly works
-    inputWs = WorkspaceCreationHelper::create1DWorkspaceRand(wsSize);
+    inputWs = WorkspaceCreationHelper::create1DWorkspaceRand(wsSize, true);
     algZero.setProperty("InputWorkspace", inputWs);
     algZero.setProperty("SetError", "zero");
     algZero.setProperty("OutputWorkspace", wsName);
diff --git a/Framework/Algorithms/test/SpecularReflectionCalculateThetaTest.h b/Framework/Algorithms/test/SpecularReflectionCalculateThetaTest.h
index 1a1fa6281c8e5cdce36e5f0ae639e2538cb836f0..56b67a603661b04628cc78e37332d53c1cef27d8 100644
--- a/Framework/Algorithms/test/SpecularReflectionCalculateThetaTest.h
+++ b/Framework/Algorithms/test/SpecularReflectionCalculateThetaTest.h
@@ -49,7 +49,7 @@ public:
     IAlgorithm_sptr alg = makeAlgorithm();
     alg->setProperty(
         "InputWorkspace",
-        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 1));
+        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 1, true));
 
     SpecularReflectionAlgorithmTest::
         test_throws_if_SpectrumNumbersOfDetectors_less_than_zero(alg);
@@ -59,7 +59,7 @@ public:
     IAlgorithm_sptr alg = makeAlgorithm();
     alg->setProperty(
         "InputWorkspace",
-        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 1));
+        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 1, true));
 
     SpecularReflectionAlgorithmTest::
         test_throws_if_SpectrumNumbersOfDetectors_outside_range(alg);
diff --git a/Framework/Algorithms/test/SpecularReflectionPositionCorrectTest.h b/Framework/Algorithms/test/SpecularReflectionPositionCorrectTest.h
index e12557edfae065e64aad4b59aab082342794c2ad..91fb8bad58f1425cce102d773d5c27b473a78f82 100644
--- a/Framework/Algorithms/test/SpecularReflectionPositionCorrectTest.h
+++ b/Framework/Algorithms/test/SpecularReflectionPositionCorrectTest.h
@@ -46,7 +46,7 @@ public:
     alg.initialize();
     alg.setProperty(
         "InputWorkspace",
-        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 1));
+        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 1, true));
     alg.setPropertyValue("OutputWorkspace", "test_out");
     TS_ASSERT_THROWS(alg.execute(), std::runtime_error &);
   }
@@ -57,7 +57,7 @@ public:
     alg.initialize();
     alg.setProperty(
         "InputWorkspace",
-        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 1));
+        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 1, true));
     alg.setPropertyValue("OutputWorkspace", "test_out");
     TS_ASSERT_THROWS(alg.setProperty("TwoThetaIn", 0.0),
                      std::invalid_argument &);
@@ -69,7 +69,7 @@ public:
     alg.initialize();
     alg.setProperty(
         "InputWorkspace",
-        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 1));
+        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 1, true));
     alg.setPropertyValue("OutputWorkspace", "test_out");
     TS_ASSERT_THROWS(alg.setProperty("TwoThetaIn", 90.0),
                      std::invalid_argument &);
@@ -82,7 +82,7 @@ public:
     alg->initialize();
     alg->setProperty(
         "InputWorkspace",
-        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 1));
+        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 1, true));
     alg->setPropertyValue("OutputWorkspace", "test_out");
     alg->setProperty("TwoThetaIn", 10.0);
 
diff --git a/Framework/Crystal/inc/MantidCrystal/FindSXPeaks.h b/Framework/Crystal/inc/MantidCrystal/FindSXPeaks.h
index 0cf2233fa7bdd7638669cca0d331e43f9aa44093..fd1907f08b2330c90b9ef81c5194bf9e49834aaa 100644
--- a/Framework/Crystal/inc/MantidCrystal/FindSXPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/FindSXPeaks.h
@@ -6,6 +6,7 @@
 //----------------------------------------------------------------------
 #include "MantidAPI/Algorithm.h"
 #include "MantidAPI/IPeaksWorkspace_fwd.h"
+#include "MantidAPI/SpectrumInfo.h"
 #include "MantidDataObjects/PeaksWorkspace.h"
 
 namespace Mantid {
@@ -17,20 +18,17 @@ public:
   /**
   Constructor
   @param t : tof
-  @param th2 : 2 * theta angle
   @param phi : psi angle
   @param intensity : peak intensity
   @param spectral : contributing spectra
-  @param Ltot : detector-sample absolute distance
-  @param detectorId : id of the contributing detector
-  @param inst: geometry of the instrument
+  @param wsIndex : ws index of the contributing spectrum
+  @param spectrumInfo: spectrum info of the original ws.
   */
-  SXPeak(double t, double th2, double phi, double intensity,
-         const std::vector<int> &spectral, double Ltot,
-         Mantid::detid_t detectorId,
-         Mantid::Geometry::Instrument_const_sptr inst)
-      : _t(t), _th2(th2), _phi(phi), _intensity(intensity), _Ltot(Ltot),
-        _detectorId(detectorId), _inst(inst) {
+  SXPeak(double t, double phi, double intensity,
+         const std::vector<int> &spectral, const size_t wsIndex,
+         const API::SpectrumInfo &spectrumInfo)
+      : _t(t), _phi(phi), _intensity(intensity), _spectral(spectral),
+        _wsIndex(wsIndex) {
     // Sanity checks
     if (intensity < 0) {
       throw std::invalid_argument("SXPeak: Cannot have an intensity < 0");
@@ -39,12 +37,29 @@ public:
       throw std::invalid_argument(
           "SXPeak: Cannot have zero sized spectral list");
     }
-    if (Ltot < 0) {
+    if (!spectrumInfo.hasDetectors(_wsIndex)) {
+      throw std::invalid_argument("SXPeak: Spectrum at ws index " +
+                                  std::to_string(wsIndex) +
+                                  " doesn't have detectors");
+    }
+    _th2 = spectrumInfo.twoTheta(_wsIndex);
+    _Ltot = spectrumInfo.l1() + spectrumInfo.l2(_wsIndex);
+    if (_Ltot < 0) {
       throw std::invalid_argument("SXPeak: Cannot have detector distance < 0");
     }
+    _detId = spectrumInfo.detector(_wsIndex).getID();
     npixels = 1;
-    _spectral.resize(spectral.size());
-    std::copy(spectral.begin(), spectral.end(), _spectral.begin());
+
+    const auto samplePos = spectrumInfo.samplePosition();
+    const auto sourcePos = spectrumInfo.sourcePosition();
+    const auto detPos = spectrumInfo.position(_wsIndex);
+    // Normalized beam direction
+    auto beamDir = samplePos - sourcePos;
+    beamDir.normalize();
+    // Normalized detector direction
+    auto detDir = (detPos - samplePos);
+    detDir.normalize();
+    _unitWaveVector = beamDir - detDir;
   }
   /**
   Object comparision
@@ -69,17 +84,6 @@ public:
   @return q vector
   */
   Mantid::Kernel::V3D getQ() const {
-    auto samplePos = _inst->getSample()->getPos();
-    auto sourcePos = _inst->getSource()->getPos();
-    auto detPos = _inst->getDetector(_detectorId)->getPos();
-
-    // Normalized beam direction
-    auto beamDir = samplePos - sourcePos;
-    beamDir /= beamDir.norm();
-    // Normalized detector direction
-    auto detDir = (detPos - samplePos);
-    detDir /= detDir.norm();
-
     double vi = _Ltot / (_t * 1e-6);
     // wavenumber = h_bar / mv
     double wi =
@@ -89,7 +93,7 @@ public:
     // wavevector=1/wavenumber = 2pi/wavelength
     double wvi = 1.0 / wi;
     // Now calculate the wavevector of the scattered neutron
-    return (beamDir - detDir) * wvi;
+    return _unitWaveVector * wvi;
   }
 
   /**
@@ -130,9 +134,9 @@ public:
   */
   const double &getIntensity() const { return _intensity; }
   /**
-  Getter for the detector id.
+  Getter for the detector Id.
   */
-  const Mantid::detid_t &getDetectorId() const { return _detectorId; }
+  detid_t getDetectorId() const { return _detId; }
 
 private:
   /// TOF
@@ -147,11 +151,14 @@ private:
   std::vector<int> _spectral;
   /// Detector-sample distance
   double _Ltot;
-  /// Detector id
-  Mantid::detid_t _detectorId;
+  /// Detector workspace index
+  size_t _wsIndex;
+  /// Detector ID
+  detid_t _detId;
   /// Number of contributing pixels
   int npixels;
-  Mantid::Geometry::Instrument_const_sptr _inst;
+  /// Unit vector in the direction of the wavevector
+  Kernel::V3D _unitWaveVector;
 };
 
 typedef std::vector<SXPeak> peakvector;
diff --git a/Framework/Crystal/src/FindSXPeaks.cpp b/Framework/Crystal/src/FindSXPeaks.cpp
index cb45e50b5d625c9ddd7339ff8760002013c4e27a..4178d8db8c8fa9fe78bf8c4eae9adcc66acd7abc 100644
--- a/Framework/Crystal/src/FindSXPeaks.cpp
+++ b/Framework/Crystal/src/FindSXPeaks.cpp
@@ -99,10 +99,7 @@ void FindSXPeaks::exec() {
   Progress progress(this, 0, 1, (m_MaxSpec - m_MinSpec + 1));
 
   // Calculate the primary flight path.
-  Kernel::V3D sample = localworkspace->getInstrument()->getSample()->getPos();
-  Kernel::V3D source = localworkspace->getInstrument()->getSource()->getPos();
-  Kernel::V3D L1 = sample - source;
-  double l1 = L1.norm();
+  const auto &spectrumInfo = localworkspace->spectrumInfo();
 
   peakvector entries;
   // Reserve 1000 peaks to make later push_back fast for first 1000 peaks, but
@@ -155,34 +152,26 @@ void FindSXPeaks::exec() {
     double rightBinEdge = *std::next(leftBinPosition);
     double tof = 0.5 * (leftBinEdge + rightBinEdge);
 
-    Geometry::IDetector_const_sptr det;
-    try {
-      det = localworkspace->getDetector(static_cast<size_t>(i));
-    } catch (Mantid::Kernel::Exception::NotFoundError &) {
-      // Catch if no detector. Next line tests whether this happened - test
-      // placed
-      // outside here because Mac Intel compiler doesn't like 'continue' in a
-      // catch
-      // in an openmp block.
-    }
     // If no detector found, skip onto the next spectrum
-    if (!det)
+    if (!spectrumInfo.hasDetectors(static_cast<size_t>(i))) {
       continue;
+    }
+    if (!spectrumInfo.hasUniqueDetector(i)) {
+      std::ostringstream sout;
+      sout << "Spectrum at workspace index " << i
+           << " has unsupported number of detectors.";
+      throw std::runtime_error(sout.str());
+    }
+    const auto &det = spectrumInfo.detector(static_cast<size_t>(i));
 
-    double phi = det->getPhi();
+    double phi = det.getPhi();
     if (phi < 0) {
       phi += 2.0 * M_PI;
     }
 
-    double th2 = det->getTwoTheta(sample, L1);
-
     std::vector<int> specs(1, i);
 
-    Mantid::Kernel::V3D L2 = det->getPos();
-    L2 -= sample;
-
-    SXPeak peak(tof, th2, phi, *maxY, specs, l1 + L2.norm(), det->getID(),
-                localworkspace->getInstrument());
+    SXPeak peak(tof, phi, *maxY, specs, i, spectrumInfo);
     PARALLEL_CRITICAL(entries) { entries.push_back(peak); }
     progress.report();
     PARALLEL_END_INTERUPT_REGION
diff --git a/Framework/Crystal/test/FindSXPeaksTest.h b/Framework/Crystal/test/FindSXPeaksTest.h
index 85695499becb648bd1c61a592a71333e567b8b22..3e9114d1aef3eac5cffa0c848a1744e105a75f4a 100644
--- a/Framework/Crystal/test/FindSXPeaksTest.h
+++ b/Framework/Crystal/test/FindSXPeaksTest.h
@@ -2,6 +2,7 @@
 #define FIND_SX_PEAKSTEST_H_
 
 #include <cxxtest/TestSuite.h>
+#include "MantidDataHandling/GroupDetectors2.h"
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
 #include "MantidCrystal/FindSXPeaks.h"
 #include "MantidGeometry/Crystal/IPeak.h"
@@ -43,13 +44,11 @@ public:
   void testSXPeakConstructorThrowsIfNegativeIntensity() {
     auto workspace =
         WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(10, 10);
-    auto instrument = workspace->getInstrument();
+    const auto &spectrumInfo = workspace->spectrumInfo();
     double intensity = -1; // Negative intensity.
     std::vector<int> spectra(1, 1);
-    double detectorDistance = 3;
     TSM_ASSERT_THROWS("SXPeak: Should not construct with a negative intensity",
-                      SXPeak(0.001, 0.02, 0.01, intensity, spectra,
-                             detectorDistance, 1, instrument),
+                      SXPeak(0.001, 0.02, intensity, spectra, 0, spectrumInfo),
                       std::invalid_argument);
   }
 
@@ -57,41 +56,22 @@ public:
   void testSXPeakConstructorThrowsIfSpectraSizeZero() {
     auto workspace =
         WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(10, 10);
-    auto instrument = workspace->getInstrument();
+    const auto &spectrumInfo = workspace->spectrumInfo();
     double intensity = 1;
     std::vector<int> spectra; // Zero size spectra list
-    double detectorDistance = 3;
     TSM_ASSERT_THROWS(
         "SXPeak: Should not construct with a zero size specral list",
-        SXPeak(0.001, 0.02, 0.01, intensity, spectra, detectorDistance, 1,
-               instrument),
-        std::invalid_argument);
-  }
-
-  // Test out of bounds construction arguments.
-  void testSXPeakConstructorThrowsIfNegativeDetectorDistance() {
-    auto workspace =
-        WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(10, 10);
-    auto instrument = workspace->getInstrument();
-    double intensity = 1;
-    std::vector<int> spectra(1, 1);
-    double detectorDistance = -1; // Negative detector distance
-    TSM_ASSERT_THROWS(
-        "SXPeak: Should not construct with a zero size specral list",
-        SXPeak(0.001, 0.02, 0.01, intensity, spectra, detectorDistance, 1,
-               instrument),
+        SXPeak(0.001, 0.02, intensity, spectra, 0, spectrumInfo),
         std::invalid_argument);
   }
 
   void testSXPeakGetters() {
     auto workspace =
         WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(10, 10);
-    auto instrument = workspace->getInstrument();
+    const auto &spectrumInfo = workspace->spectrumInfo();
     double intensity = 1;
     std::vector<int> spectra(1, 1);
-    double detectorDistance = 3;
-    SXPeak peak(0.001, 0.02, 0.01, intensity, spectra, detectorDistance, 2,
-                instrument);
+    SXPeak peak(0.001, 0.02, intensity, spectra, 1, spectrumInfo);
 
     TSM_ASSERT_EQUALS("Intensity getter is not wired-up correctly", 1,
                       peak.getIntensity());
@@ -238,6 +218,29 @@ public:
                       results[2]);
   }
 
+  void testSpectrumWithoutUniqueDetectorsThrows() {
+    const int nHist = 10;
+    Workspace2D_sptr workspace =
+        WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(nHist, 10);
+    makeOnePeak(2, 400, 5, workspace);
+    Mantid::DataHandling::GroupDetectors2 grouping;
+    grouping.setChild(true);
+    grouping.initialize();
+    grouping.setProperty("InputWorkspace", workspace);
+    grouping.setProperty("OutputWorkspace", "unused_for_child");
+    grouping.setProperty("GroupingPattern", "0,1-3,4,5");
+    grouping.execute();
+    MatrixWorkspace_sptr grouped = grouping.getProperty("OutputWorkspace");
+    std::cout << grouped->getNumberHistograms() << '\n';
+    FindSXPeaks alg;
+    alg.initialize();
+    alg.setProperty("InputWorkspace", grouped);
+    alg.setProperty("OutputWorkspace", "found_peaks");
+    alg.setRethrows(true);
+    TSM_ASSERT_THROWS_ANYTHING("FindSXPeak should have thrown.", alg.execute());
+    TSM_ASSERT("FindSXPeak should not have been executed.", !alg.isExecuted());
+  }
+
   void testUseWorkspaceRangeCropping() {
     // creates a workspace where all y-values are 2
     Workspace2D_sptr workspace =
diff --git a/Framework/Crystal/test/IntegratePeakTimeSlicesTest.h b/Framework/Crystal/test/IntegratePeakTimeSlicesTest.h
index 7dd89cc118d56d34ed003290285d1a97d29068cf..12d1c596fbd4b38db51816a130bb24590d39bc08 100644
--- a/Framework/Crystal/test/IntegratePeakTimeSlicesTest.h
+++ b/Framework/Crystal/test/IntegratePeakTimeSlicesTest.h
@@ -17,6 +17,7 @@
 #include "MantidAPI/AlgorithmFactory.h"
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/Axis.h"
+#include "MantidAPI/DetectorInfo.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/SpectraDetectorTypes.h"
@@ -96,22 +97,16 @@ public:
 
     boost::shared_ptr<Geometry::Detector> pixelp =
         bankR->getAtXY(PeakCol, PeakRow);
-
-    Geometry::IDetector_const_sptr pix = wsPtr->getDetector(522);
+    const auto &detectorInfo = wsPtr->detectorInfo();
+    const auto detInfoIndex = detectorInfo.indexOf(pixelp->getID());
 
     // Now get Peak.
     double PeakTime = 18000 + (PeakChan + .5) * 100;
 
     Mantid::Kernel::Units::Wavelength wl;
-    Kernel::V3D pos = Kernel::V3D(instP->getSource()->getPos());
-    pos -= instP->getSample()->getPos();
-    double L1 = pos.norm();
-    Kernel::V3D pos1 = pixelp->getPos();
-    pos1 -= instP->getSample()->getPos();
-    double L2 = pos1.norm();
-    double dummy, phi;
-    pos1.getSpherical(dummy, phi, dummy);
-    double ScatAng = phi / 180 * M_PI;
+    const auto L1 = detectorInfo.l1();
+    const auto L2 = detectorInfo.l2(detInfoIndex);
+    const auto ScatAng = detectorInfo.twoTheta(detInfoIndex) / 180 * M_PI;
     std::vector<double> x;
     x.push_back(PeakTime);
 
@@ -122,7 +117,8 @@ public:
 
     // Now set up data in workspace2D
     double dQ = 0;
-    double Q0 = calcQ(bankR, instP, PeakRow, PeakCol, 1000.0 + 30.0 * 50);
+    double Q0 =
+        calcQ(bankR, detectorInfo, PeakRow, PeakCol, 1000.0 + 30.0 * 50);
 
     double TotIntensity = 0;
 
@@ -153,7 +149,7 @@ public:
           dataY.push_back(val);
           dataE.push_back(sqrt(val));
           if ((val - 1.4) > MaxPeakIntensity * .1) {
-            double Q = calcQ(bankR, instP, row, col, 1000.0 + chan * 50);
+            double Q = calcQ(bankR, detectorInfo, row, col, 1000.0 + chan * 50);
             dQ = max<double>(dQ, fabs(Q - Q0));
           }
         }
@@ -238,18 +234,17 @@ private:
    *   Calculates Q
    */
   double calcQ(RectangularDetector_const_sptr bankP,
-               boost::shared_ptr<const Instrument> instPtr, int row, int col,
+               const DetectorInfo &detectorInfo, int row, int col,
                double time) {
     boost::shared_ptr<Detector> detP = bankP->getAtXY(col, row);
-
-    double L2 = detP->getDistance(*(instPtr->getSample()));
+    const auto detInfoIndex = detectorInfo.indexOf(detP->getID());
+    const auto L1 = detectorInfo.l1();
+    const auto L2 = detectorInfo.l2(detInfoIndex);
 
     Kernel::Units::MomentumTransfer Q;
     std::vector<double> x;
     x.push_back(time);
-    double L1 = instPtr->getSample()->getDistance(*(instPtr->getSource()));
-    Kernel::V3D pos = detP->getPos();
-    double ScatAng = fabs(asin(pos.Z() / pos.norm()));
+    const auto ScatAng = detectorInfo.twoTheta(detInfoIndex) / 180 * M_PI;
 
     Q.fromTOF(x, x, L1, L2, ScatAng, 0, 0, 0.0);
 
diff --git a/Framework/Crystal/test/PeaksInRegionTest.h b/Framework/Crystal/test/PeaksInRegionTest.h
index f90191a469ddc8e5ad44fa19de0caad440b3e8e6..dc94c4bb1b3502a4724c7dc6b1e97f0d214b560c 100644
--- a/Framework/Crystal/test/PeaksInRegionTest.h
+++ b/Framework/Crystal/test/PeaksInRegionTest.h
@@ -2,10 +2,11 @@
 #define MANTID_CRYSTAL_PEAKSINREGIONTEST_H_
 
 #include <cxxtest/TestSuite.h>
-#include "MantidTestHelpers/WorkspaceCreationHelper.h"
-#include "MantidTestHelpers/ComponentCreationHelper.h"
-#include "MantidDataObjects/PeaksWorkspace.h"
+#include "MantidAPI/DetectorInfo.h"
 #include "MantidCrystal/PeaksInRegion.h"
+#include "MantidDataObjects/PeaksWorkspace.h"
+#include "MantidTestHelpers/ComponentCreationHelper.h"
+#include "MantidTestHelpers/WorkspaceCreationHelper.h"
 #include <boost/tuple/tuple.hpp>
 
 using namespace Mantid::Crystal;
@@ -30,7 +31,7 @@ private:
                        double yMaxFromPeak, double zMinFromPeak,
                        double zMaxFromPeak) {
     PeaksWorkspace_sptr ws = WorkspaceCreationHelper::createPeaksWorkspace(1);
-    auto detectorIds = ws->getInstrument()->getDetectorIDs();
+    const auto &detectorIds = ws->detectorInfo().detectorIDs();
     Peak &peak = ws->getPeak(0);
     peak.setDetectorID(detectorIds.front());
     Mantid::Kernel::V3D position;
@@ -398,7 +399,6 @@ public:
         0, 1, 0, 1, 0, 1}; // Extents go from 0, 1 in each dimension.
 
     PeaksWorkspace_sptr ws = WorkspaceCreationHelper::createPeaksWorkspace(1);
-    auto detectorIds = ws->getInstrument()->getDetectorIDs();
     Peak &peak = ws->getPeak(0);
     peak.setHKL(Mantid::Kernel::V3D(2, 0, 0)); // This point is actually on the
                                                // y = 0 plane, i.e. satisfies
diff --git a/Framework/CurveFitting/test/FunctionParameterDecoratorFitTest.h b/Framework/CurveFitting/test/FunctionParameterDecoratorFitTest.h
index 375f273bd9dc14bd7e0ee11cc0afccb29d840e2d..a76c7be15f46767b3037e4891ffbe9749deb6e0b 100644
--- a/Framework/CurveFitting/test/FunctionParameterDecoratorFitTest.h
+++ b/Framework/CurveFitting/test/FunctionParameterDecoratorFitTest.h
@@ -75,7 +75,7 @@ public:
 
   void testFit() {
     Workspace2D_sptr ws =
-        WorkspaceCreationHelper::create1DWorkspaceConstant(20, 1.5, 0.5);
+        WorkspaceCreationHelper::create1DWorkspaceConstant(20, 1.5, 0.5, true);
 
     FunctionParameterDecorator_sptr fn =
         boost::make_shared<SimpleFunctionParameterDecorator>();
diff --git a/Framework/CurveFitting/test/Functions/DiffRotDiscreteCircleTest.h b/Framework/CurveFitting/test/Functions/DiffRotDiscreteCircleTest.h
index 1c6ce5f34b47d67c7cbd278e10e9b7c5631e771f..03e37d9621c4e18a7551964566606b3988877e6f 100644
--- a/Framework/CurveFitting/test/Functions/DiffRotDiscreteCircleTest.h
+++ b/Framework/CurveFitting/test/Functions/DiffRotDiscreteCircleTest.h
@@ -239,7 +239,7 @@ public:
         "(composite=Convolution,FixResolution=true,NumDeriv=true;name=Gaussian,"
         "Height=1,PeakCentre=0,Sigma=20,ties=(Height=1,PeakCentre=0,Sigma=20);("
         "name=DiffRotDiscreteCircle,N=3,NumDeriv=true,Q=0.5,Intensity=47.014,"
-        "Radius=1.567,Decay=7.567))";
+        "Radius=1.567,Decay=0.07567))";
 
     // Initialize the fit function in the Fit algorithm
     Algorithms::Fit fitalg;
@@ -258,7 +258,7 @@ public:
                      "name=Gaussian,Height=1,PeakCentre=0,Sigma=20,ties=("
                      "Height=1,PeakCentre=0,Sigma=20);(name="
                      "DiffRotDiscreteCircle,N=3,NumDeriv=true,Q=0.5,Intensity="
-                     "10.0,Radius=1.567,Decay=20.0))";
+                     "20.0,Radius=1.567,Decay=0.1))";
     fitalg.setProperty("Function", funtion_string);
     fitalg.setProperty("InputWorkspace", data_workspace);
     fitalg.setPropertyValue("WorkspaceIndex", "0");
@@ -296,10 +296,10 @@ public:
                     47.014 * 0.05); // allow for a small percent variation
     TS_ASSERT_DELTA(fitalg_structure_factor->getParameter("Radius"), 1.567,
                     1.567 * 0.05); // allow for a small percent variation
-    TS_ASSERT_DELTA(fitalg_structure_factor->getParameter("Decay"), 7.567,
+    TS_ASSERT_DELTA(fitalg_structure_factor->getParameter("Decay"), 0.07567,
                     7.567 * 0.05); // allow for a small percent variation
     // std::cout << "\nGOAL: Intensity = 47.014,  Radius = 1.567,  Decay =
-    // 7.567\n"; // only for debugging purposes
+    // 0.07567\n"; // only for debugging purposes
     // std::cout << "OPTIMIZED: Intensity = " <<
     // fitalg_structure_factor->getParameter("Intensity") << "  Radius = " <<
     // fitalg_structure_factor->getParameter("Radius") << "  Decay = " <<
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadMLZ.h b/Framework/DataHandling/inc/MantidDataHandling/LoadMLZ.h
index 5c5a1a70fa0e7eb9fd43a081683b33cf665a01ef..7e67910de433e3668db2540e6005f09fe565aa7f 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadMLZ.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadMLZ.h
@@ -5,8 +5,8 @@
 // Includes
 //---------------------------------------------------
 #include "MantidAPI/IFileLoader.h"
-#include "MantidNexus/NexusClasses.h"
 #include "MantidDataHandling/LoadHelper.h"
+#include "MantidNexus/NexusClasses.h"
 
 namespace Mantid {
 namespace DataHandling {
@@ -54,20 +54,15 @@ private:
   void init() override;
   void exec() override;
 
-  // int getEPPFromVanadium(const std::string
-  // &,Mantid::API::MatrixWorkspace_sptr);
   void loadInstrumentDetails(NeXus::NXEntry &);
   void loadTimeDetails(NeXus::NXEntry &entry);
 
   std::vector<std::vector<int>> getMonitorInfo(NeXus::NXEntry &firstEntry);
 
-  // void initWorkSpace(NeXus::NXEntry& entry, const
-  // std::vector<std::vector<int> >&);
   void initWorkSpace(NeXus::NXEntry &entry);
   void initInstrumentSpecific();
   void loadRunDetails(NeXus::NXEntry &entry);
   void loadExperimentDetails(NeXus::NXEntry &entry);
-  // int getDetectorElasticPeakPosition(const NeXus::NXInt &data);
 
   NeXus::NXData loadNexusFileData(NeXus::NXEntry &entry);
   void maskDetectors(NeXus::NXEntry &entry);
@@ -76,15 +71,8 @@ private:
 
   void runLoadInstrument();
 
-  /// Calculate error for y
-  static double calculateError(double in) { return sqrt(in); }
-  // int validateVanadium(const std::string &);
-
   API::MatrixWorkspace_sptr m_localWorkspace;
 
-  //	NeXus::NXRoot m_dataRoot;
-  //	NeXus::NXRoot m_vanaRoot;
-
   std::string m_instrumentName; ///< Name of the instrument
   std::string m_instrumentPath; ///< Name of the instrument path
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus2.h b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus2.h
index e5894c381cf0ec17929b704ee8deb348d2d2a669..38f9560f2e97e494d09f6fbb2369e92bb94b90c9 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus2.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus2.h
@@ -89,9 +89,9 @@ private:
   /// Execute this version of the algorithm
   void doExec();
 
-  void loadData(const Mantid::NeXus::NXInt &counts,
-                const std::vector<double> &timeBins, int wsIndex, int period,
-                int spec, API::MatrixWorkspace_sptr localWorkspace);
+  HistogramData::Histogram
+  loadData(const Mantid::HistogramData::BinEdges &edges,
+           const Mantid::NeXus::NXInt &counts, int period, int spec);
   void loadLogs(API::MatrixWorkspace_sptr ws, Mantid::NeXus::NXEntry &entry,
                 int period);
   void loadRunDetails(DataObjects::Workspace2D_sptr localWorkspace);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadNexusMonitors2.h b/Framework/DataHandling/inc/MantidDataHandling/LoadNexusMonitors2.h
index 39157303eacc33ed780b58057992f4ad4703d680..e9d6387b98ffc9fd6ac702446e118332e76c2cd9 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadNexusMonitors2.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadNexusMonitors2.h
@@ -9,41 +9,46 @@
 #include <nexus/NeXusException.hpp>
 
 namespace Mantid {
+
+namespace HistogramData {
+class Counts;
+class BinEdges;
+}
 namespace DataHandling {
 
 /**
- * Load Monitors from NeXus files.
- *
- * Required Properties:
- * <UL>
- *   <LI> Filename - The name of and path to the input NeXus file </LI>
- *   <LI> Workspace - The name of the workspace to output</LI>
- * </UL>
- *
- * @author Michael Reuter, SNS
- * @author Michael Hart, ISIS
- * @date December 4, 2015
- *
- * Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
- * National Laboratory & European Spallation Source
- *
- * This file is part of Mantid.
- *
- * Mantid is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Mantid is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- * File change history is stored at: <https://github.com/mantidproject/mantid>
- */
+* Load Monitors from NeXus files.
+*
+* Required Properties:
+* <UL>
+*   <LI> Filename - The name of and path to the input NeXus file </LI>
+*   <LI> Workspace - The name of the workspace to output</LI>
+* </UL>
+*
+* @author Michael Reuter, SNS
+* @author Michael Hart, ISIS
+* @date December 4, 2015
+*
+* Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+* National Laboratory & European Spallation Source
+*
+* This file is part of Mantid.
+*
+* Mantid is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 3 of the License, or
+* (at your option) any later version.
+*
+* Mantid is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*
+* File change history is stored at: <https://github.com/mantidproject/mantid>
+*/
 class DLLExport LoadNexusMonitors2 : public API::Algorithm {
 public:
   /// Algorithm's name for identification
@@ -104,16 +109,18 @@ private:
 
   void readEventMonitorEntry(NeXus::File &file, size_t i);
 
-  void readHistoMonitorEntry(NeXus::File &file, size_t i);
+  void readHistoMonitorEntry(NeXus::File &file, size_t i, size_t numPeriods);
 
 private:
+  std::vector<HistogramData::BinEdges> m_multiPeriodBinEdges;
+  std::vector<HistogramData::Counts> m_multiPeriodCounts;
   std::string m_filename; ///< The name and path of the input file
   API::MatrixWorkspace_sptr m_workspace; ///< The workspace being filled out
   size_t m_monitor_count{0};             ///< Number of monitors
   std::string m_top_entry_name;          ///< name of top level NXentry to use
   bool m_allMonitorsHaveHistoData{
       false}; ///< Flag that all monitors have histogram
-  /// data in the entry
+              /// data in the entry
 };
 
 } // namespace DataHandling
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadPDFgetNFile.h b/Framework/DataHandling/inc/MantidDataHandling/LoadPDFgetNFile.h
index 9c2fd390380eba5ac252c531b8d2c497fb13801a..535770755f2b6853a9cfb4ae7123a86dab8c79c6 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadPDFgetNFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadPDFgetNFile.h
@@ -1,9 +1,9 @@
 #ifndef MANTID_DATAHANDLING_LOADPDFGETNFILE_H_
 #define MANTID_DATAHANDLING_LOADPDFGETNFILE_H_
 
-#include "MantidKernel/System.h"
 #include "MantidAPI/IFileLoader.h"
 #include "MantidDataObjects/Workspace2D.h"
+#include "MantidKernel/System.h"
 
 namespace Mantid {
 namespace DataHandling {
@@ -83,6 +83,8 @@ private:
 
   /// Set X and Y axis unit and lebel
   void setUnit(DataObjects::Workspace2D_sptr ws);
+
+  void checkSameSize(const std::vector<size_t> &numptsvec, size_t numsets);
 };
 
 } // namespace DataHandling
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveAscii2.h b/Framework/DataHandling/inc/MantidDataHandling/SaveAscii2.h
index 009c501717f9ac035bebad90779a0be410220bbf..7acc33762aeb3afd840b8dcecef0098b417cd41f 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveAscii2.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveAscii2.h
@@ -87,7 +87,6 @@ private:
   std::string m_sep;
   bool m_writeDX;
   bool m_writeID;
-  bool m_isHistogram;
   bool m_isCommonBins;
   API::MatrixWorkspace_const_sptr m_ws;
   std::vector<std::string> m_metaData;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SetScalingPSD.h b/Framework/DataHandling/inc/MantidDataHandling/SetScalingPSD.h
index 014b28866eaa86aeb50727285a5054ed18a6945a..cf3516c8363cfecc927fe7fe6240bfbc3842a25f 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SetScalingPSD.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SetScalingPSD.h
@@ -97,10 +97,6 @@ private:
   API::MatrixWorkspace_sptr m_workspace; ///< Pointer to the workspace
   // void runMoveInstrumentComp(const int& detIndex, const Kernel::V3D& shift);
 
-  /// get a vector of shared pointers to each detector in the comp
-  void findAll(boost::shared_ptr<const Geometry::IComponent> comp);
-  /// the vector of shared pointers
-  std::vector<boost::shared_ptr<const Geometry::IComponent>> m_vectDet;
   /// apply the shifts in posMap to the detectors in WS
   void movePos(API::MatrixWorkspace_sptr &WS,
                std::map<int, Kernel::V3D> &posMap,
diff --git a/Framework/DataHandling/src/LoadDspacemap.cpp b/Framework/DataHandling/src/LoadDspacemap.cpp
index e71748e59cc187f6705d320ae0478ac18688aa2d..1198443b96a9ff718779d582bfd8666a37be4078 100644
--- a/Framework/DataHandling/src/LoadDspacemap.cpp
+++ b/Framework/DataHandling/src/LoadDspacemap.cpp
@@ -1,4 +1,5 @@
 #include "MantidDataHandling/LoadDspacemap.h"
+#include "MantidAPI/DetectorInfo.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidDataHandling/LoadCalFile.h"
 #include "MantidDataObjects/EventWorkspace.h"
@@ -91,16 +92,9 @@ void LoadDspacemap::CalculateOffsetsFromDSpacemapFile(
     const std::string DFileName,
     Mantid::DataObjects::OffsetsWorkspace_sptr offsetsWS) {
   // Get a pointer to the instrument contained in the workspace
-  Instrument_const_sptr instrument = offsetsWS->getInstrument();
-  double l1;
-  Kernel::V3D beamline, samplePos;
-  double beamline_norm;
-  instrument->getInstrumentParameters(l1, beamline, beamline_norm, samplePos);
-
-  // To get all the detector ID's
-  detid2det_map allDetectors;
-  instrument->getDetectors(allDetectors);
 
+  const auto &detectorInfo = offsetsWS->detectorInfo();
+  const double l1 = detectorInfo.l1();
   // Read in the POWGEN-style Dspace mapping file
   const char *filename = DFileName.c_str();
   std::ifstream fin(filename, std::ios_base::in | std::ios_base::binary);
@@ -114,19 +108,21 @@ void LoadDspacemap::CalculateOffsetsFromDSpacemapFile(
     dspace.push_back(read);
   }
 
-  detid2det_map::const_iterator it;
-  for (it = allDetectors.begin(); it != allDetectors.end(); ++it) {
-    detid_t detectorID = it->first;
-    Geometry::IDetector_const_sptr det = it->second;
+  const auto &detectorIds = detectorInfo.detectorIDs();
+
+  for (size_t detectorIndex = 0; detectorIndex < detectorInfo.size();
+       ++detectorIndex) {
+    const auto detectorId = detectorIds[detectorIndex];
 
     // Compute the factor
     double offset = 0.0;
-    double factor = Instrument::calcConversion(
-        l1, beamline, beamline_norm, samplePos, det->getPos(), offset);
-    offset = dspace[detectorID] / factor - 1.0;
+    double factor = Geometry::Conversion::tofToDSpacingFactor(
+        l1, detectorInfo.l2(detectorIndex),
+        detectorInfo.twoTheta(detectorIndex), offset);
+    offset = dspace[detectorId] / factor - 1.0;
     // Save in the map
     try {
-      offsetsWS->setValue(detectorID, offset);
+      offsetsWS->setValue(detectorId, offset);
     } catch (std::invalid_argument &) {
     }
   }
diff --git a/Framework/DataHandling/src/LoadMLZ.cpp b/Framework/DataHandling/src/LoadMLZ.cpp
index 2cc2328ee35d5d28fe3f63f23beabf90179b932a..29d017add5012fdb23d389f2b4f2c42fc5eb0f01 100644
--- a/Framework/DataHandling/src/LoadMLZ.cpp
+++ b/Framework/DataHandling/src/LoadMLZ.cpp
@@ -1,5 +1,4 @@
 #include "MantidDataHandling/LoadMLZ.h"
-#include "MantidDataHandling/LoadHelper.h"
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/DetectorInfo.h"
 #include "MantidAPI/FileProperty.h"
@@ -8,6 +7,7 @@
 #include "MantidAPI/RegisterFileLoader.h"
 #include "MantidAPI/SpectrumInfo.h"
 #include "MantidAPI/WorkspaceFactory.h"
+#include "MantidDataHandling/LoadHelper.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidKernel/EmptyValues.h"
 #include "MantidKernel/Exception.h"
@@ -24,6 +24,8 @@ namespace DataHandling {
 using namespace Kernel;
 using namespace API;
 using namespace NeXus;
+using HistogramData::BinEdges;
+using HistogramData::Counts;
 
 // Register the algorithm into the AlgorithmFactory
 DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMLZ)
@@ -365,25 +367,17 @@ void LoadMLZ::loadDataIntoTheWorkSpace(NeXus::NXEntry &entry) {
   }
 
   // Assign calculated bins to first X axis
-  m_localWorkspace->dataX(0)
-      .assign(detectorTofBins.begin(), detectorTofBins.end());
+  BinEdges edges(std::move(detectorTofBins));
 
   Progress progress(this, 0, 1, m_numberOfTubes * m_numberOfPixelsPerTube);
   size_t spec = 0;
   for (size_t i = 0; i < m_numberOfTubes; ++i) {
     for (size_t j = 0; j < m_numberOfPixelsPerTube; ++j) {
-      if (spec > 0) {
-        // just copy the time binning axis to every spectra
-        m_localWorkspace->dataX(spec) = m_localWorkspace->readX(0);
-      }
       // Assign Y
       int *data_p = &data(static_cast<int>(i), static_cast<int>(j), 0);
 
-      m_localWorkspace->dataY(spec).assign(data_p, data_p + m_numberOfChannels);
-      // Assign Error
-      MantidVec &E = m_localWorkspace->dataE(spec);
-      std::transform(data_p, data_p + m_numberOfChannels, E.begin(),
-                     LoadMLZ::calculateError);
+      m_localWorkspace->setHistogram(
+          spec, edges, Counts(data_p, data_p + m_numberOfChannels));
 
       ++spec;
       progress.report();
diff --git a/Framework/DataHandling/src/LoadMcStasNexus.cpp b/Framework/DataHandling/src/LoadMcStasNexus.cpp
index 03b1b51760a100a8f30c9006010a73482dc9a438..cb42ae556e7722e8a473657bf0c6ad5c5f3d16fb 100644
--- a/Framework/DataHandling/src/LoadMcStasNexus.cpp
+++ b/Framework/DataHandling/src/LoadMcStasNexus.cpp
@@ -110,8 +110,8 @@ void LoadMcStasNexus::exec() {
       nxFile.readData<double>(axis1Name, axis1Values);
       nxFile.readData<double>(axis2Name, axis2Values);
 
-      const size_t axis1Length = axis1Values.size();
-      const size_t axis2Length = axis2Values.size();
+      const auto axis1Length = axis1Values.size();
+      const auto axis2Length = axis2Values.size();
       g_log.debug() << "Axis lengths=" << axis1Length << " " << axis2Length
                     << '\n';
 
@@ -147,10 +147,12 @@ void LoadMcStasNexus::exec() {
       ws->setYUnit(axis2Name);
       ws->replaceAxis(1, axis2);
 
+      ws->mutableX(0) = axis1Values;
+
       for (size_t wsIndex = 0; wsIndex < axis2Length; ++wsIndex) {
-        auto &dataY = ws->dataY(wsIndex);
-        auto &dataE = ws->dataE(wsIndex);
-        auto &dataX = ws->dataX(wsIndex);
+        auto &dataY = ws->mutableY(wsIndex);
+        auto &dataE = ws->mutableE(wsIndex);
+        ws->setSharedX(wsIndex, ws->sharedX(0));
 
         for (size_t j = 0; j < axis1Length; ++j) {
           // Data is stored in column-major order so we are translating to
@@ -158,7 +160,6 @@ void LoadMcStasNexus::exec() {
           const size_t fileDataIndex = j * axis2Length + wsIndex;
 
           dataY[j] = data[fileDataIndex];
-          dataX[j] = axis1Values[j];
           if (!errors.empty())
             dataE[j] = errors[fileDataIndex];
         }
diff --git a/Framework/DataHandling/src/LoadMuonNexus1.cpp b/Framework/DataHandling/src/LoadMuonNexus1.cpp
index 025dbdac56ea1825da749c34d52b5b80dbcd2cb2..8a15493d8efd2a9747117725f9d6296bea51ca79 100644
--- a/Framework/DataHandling/src/LoadMuonNexus1.cpp
+++ b/Framework/DataHandling/src/LoadMuonNexus1.cpp
@@ -46,6 +46,8 @@ using namespace Kernel;
 using namespace API;
 using Geometry::Instrument;
 using namespace Mantid::NeXus;
+using HistogramData::BinEdges;
+using HistogramData::Counts;
 
 /// Empty default constructor
 LoadMuonNexus1::LoadMuonNexus1() : LoadMuonNexus() {}
@@ -655,25 +657,17 @@ void LoadMuonNexus1::loadData(size_t hist, specnum_t &i, specnum_t specNo,
   // Put it into a vector, discarding the 1st entry, which is rubbish
   // But note that the last (overflow) bin is kept
   // For Nexus, not sure if above is the case, hence give all data for now
-  MantidVec &Y = localWorkspace->dataY(hist);
-  Y.assign(nxload.counts + i * lengthIn,
-           nxload.counts + i * lengthIn + lengthIn);
-
-  // Create and fill another vector for the errors, containing sqrt(count)
-  MantidVec &E = localWorkspace->dataE(hist);
-  typedef double (*uf)(double);
-  uf dblSqrt = std::sqrt;
-  std::transform(Y.begin(), Y.end(), E.begin(), dblSqrt);
-  // Populate the workspace. Loop starts from 1, hence i-1
 
   // Create and fill another vector for the X axis
   auto timeChannels = new float[lengthIn + 1]();
   nxload.getTimeChannels(timeChannels, static_cast<const int>(lengthIn + 1));
   // Put the read in array into a vector (inside a shared pointer)
-  auto timeChannelsVec = boost::make_shared<HistogramData::HistogramX>(
-      timeChannels, timeChannels + lengthIn + 1);
 
-  localWorkspace->setX(hist, timeChannelsVec);
+  localWorkspace->setHistogram(
+      hist, BinEdges(timeChannels, timeChannels + lengthIn + 1),
+      Counts(nxload.counts + i * lengthIn,
+             nxload.counts + i * lengthIn + lengthIn));
+
   localWorkspace->getSpectrum(hist).setSpectrumNo(specNo);
   // Muon v1 files: always a one-to-one mapping between spectra and detectors
   localWorkspace->getSpectrum(hist).setDetectorID(static_cast<detid_t>(specNo));
diff --git a/Framework/DataHandling/src/LoadMuonNexus2.cpp b/Framework/DataHandling/src/LoadMuonNexus2.cpp
index f50c4f38723f7434adfd079adb418ba5a97328b1..6240ea6772e7320f539eab06ff74d7c188088a90 100644
--- a/Framework/DataHandling/src/LoadMuonNexus2.cpp
+++ b/Framework/DataHandling/src/LoadMuonNexus2.cpp
@@ -1,5 +1,4 @@
 #include "MantidDataHandling/LoadMuonNexus2.h"
-#include "MantidDataHandling/LoadMuonNexus1.h"
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/Progress.h"
@@ -7,17 +6,18 @@
 #include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidAPI/WorkspaceGroup.h"
+#include "MantidDataHandling/LoadMuonNexus1.h"
+#include "MantidDataObjects/Workspace2D.h"
 #include "MantidGeometry/Instrument/Detector.h"
-#include "MantidKernel/TimeSeriesProperty.h"
-#include "MantidKernel/UnitFactory.h"
-#include "MantidKernel/ConfigService.h"
 #include "MantidKernel/ArrayProperty.h"
+#include "MantidKernel/ConfigService.h"
+#include "MantidKernel/TimeSeriesProperty.h"
 #include "MantidKernel/Unit.h"
+#include "MantidKernel/UnitFactory.h"
 #include "MantidKernel/UnitLabelTypes.h"
 #include "MantidNexus/NexusClasses.h"
-#include "MantidDataObjects/Workspace2D.h"
-#include <nexus/NeXusFile.hpp>
 #include <nexus/NeXusException.hpp>
+#include <nexus/NeXusFile.hpp>
 
 #include <Poco/Path.h>
 #include <boost/lexical_cast.hpp>
@@ -34,6 +34,9 @@ DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMuonNexus2)
 using namespace Kernel;
 using namespace API;
 using Geometry::Instrument;
+using Mantid::HistogramData::Histogram;
+using Mantid::HistogramData::Counts;
+using Mantid::HistogramData::BinEdges;
 using namespace Mantid::NeXus;
 
 /// Empty default constructor
@@ -247,14 +250,16 @@ void LoadMuonNexus2::doExec() {
       index_spectrum[spectrum_index[i]] = i;
     }
 
-    int counter = 0;
+    int wsIndex = 0;
+    localWorkspace->mutableX(0) = timeBins;
     for (int spec = static_cast<int>(m_spec_min);
          spec <= static_cast<int>(m_spec_max); ++spec) {
       int i = index_spectrum[spec]; // if spec not found i is 0
-      loadData(counts, timeBins, counter, period, i, localWorkspace);
-      localWorkspace->getSpectrum(counter).setSpectrumNo(spectrum_index[i]);
-      localWorkspace->getSpectrum(counter).setDetectorIDs(detMapping.at(i));
-      counter++;
+      localWorkspace->setHistogram(
+          wsIndex, loadData(localWorkspace->binEdges(0), counts, period, i));
+      localWorkspace->getSpectrum(wsIndex).setSpectrumNo(spectrum_index[i]);
+      localWorkspace->getSpectrum(wsIndex).setDetectorIDs(detMapping.at(i));
+      wsIndex++;
       progress.report();
     }
 
@@ -262,15 +267,16 @@ void LoadMuonNexus2::doExec() {
     if (m_list) {
       for (auto spec : m_spec_list) {
         int k = index_spectrum[spec]; // if spec not found k is 0
-        loadData(counts, timeBins, counter, period, k, localWorkspace);
-        localWorkspace->getSpectrum(counter).setSpectrumNo(spectrum_index[k]);
-        localWorkspace->getSpectrum(counter).setDetectorIDs(detMapping.at(k));
-        counter++;
+        localWorkspace->setHistogram(
+            wsIndex, loadData(localWorkspace->binEdges(0), counts, period, k));
+        localWorkspace->getSpectrum(wsIndex).setSpectrumNo(spectrum_index[k]);
+        localWorkspace->getSpectrum(wsIndex).setDetectorIDs(detMapping.at(k));
+        wsIndex++;
         progress.report();
       }
     }
     // Just a sanity check
-    assert(counter == total_specs);
+    assert(wsIndex == total_specs);
 
     bool autogroup = getProperty("AutoGroup");
 
@@ -293,15 +299,9 @@ void LoadMuonNexus2::doExec() {
 /** loadData
 *  Load the counts data from an NXInt into a workspace
 */
-void LoadMuonNexus2::loadData(const Mantid::NeXus::NXInt &counts,
-                              const std::vector<double> &timeBins, int wsIndex,
-                              int period, int spec,
-                              API::MatrixWorkspace_sptr localWorkspace) {
-  MantidVec &X = localWorkspace->dataX(wsIndex);
-  MantidVec &Y = localWorkspace->dataY(wsIndex);
-  MantidVec &E = localWorkspace->dataE(wsIndex);
-  X.assign(timeBins.begin(), timeBins.end());
-
+Histogram LoadMuonNexus2::loadData(const BinEdges &edges,
+                                   const Mantid::NeXus::NXInt &counts,
+                                   int period, int spec) {
   int nBins = 0;
   int *data = nullptr;
 
@@ -312,14 +312,10 @@ void LoadMuonNexus2::loadData(const Mantid::NeXus::NXInt &counts,
     nBins = counts.dim1();
     data = &counts(spec, 0);
   } else {
-    throw std::runtime_error("Data have unsupported dimansionality");
+    throw std::runtime_error("Data have unsupported dimensionality");
   }
-  assert(nBins + 1 == static_cast<int>(timeBins.size()));
 
-  Y.assign(data, data + nBins);
-  typedef double (*uf)(double);
-  uf dblSqrt = std::sqrt;
-  std::transform(Y.begin(), Y.end(), E.begin(), dblSqrt);
+  return Histogram(edges, Counts(data, data + nBins));
 }
 
 /**  Load logs from Nexus file. Logs are expected to be in
diff --git a/Framework/DataHandling/src/LoadNXSPE.cpp b/Framework/DataHandling/src/LoadNXSPE.cpp
index 83a6eb86748c2d8971a2561fe29f973d61593843..3f1932be58afb8a3c8fdb686da02e334d94562c0 100644
--- a/Framework/DataHandling/src/LoadNXSPE.cpp
+++ b/Framework/DataHandling/src/LoadNXSPE.cpp
@@ -1,6 +1,4 @@
 #include "MantidDataHandling/LoadNXSPE.h"
-#include "MantidKernel/UnitFactory.h"
-#include "MantidKernel/DeltaEMode.h"
 #include "MantidAPI/ExperimentInfo.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/MatrixWorkspace.h"
@@ -9,10 +7,12 @@
 #include "MantidAPI/SpectraAxis.h"
 #include "MantidAPI/SpectrumInfo.h"
 #include "MantidAPI/WorkspaceFactory.h"
+#include "MantidKernel/DeltaEMode.h"
+#include "MantidKernel/UnitFactory.h"
 
-#include <nexus/NeXusFile.hpp>
-#include <nexus/NeXusException.hpp>
 #include "MantidNexus/NexusClasses.h"
+#include <nexus/NeXusException.hpp>
+#include <nexus/NeXusFile.hpp>
 
 #include "MantidGeometry/Instrument.h"
 #include "MantidGeometry/Instrument/Detector.h"
@@ -36,6 +36,7 @@ DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadNXSPE)
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
+using Mantid::HistogramData::BinEdges;
 
 /**
  * Calculate the confidence in the string value. This is used for file
@@ -299,16 +300,17 @@ void LoadNXSPE::exec() {
                                 itdataend, iterrorend;
   auto &spectrumInfo = outputWS->mutableSpectrumInfo();
   API::Progress prog = API::Progress(this, 0.0, 0.9, numSpectra);
+  BinEdges edges(std::move(energies));
   for (std::size_t i = 0; i < numSpectra; ++i) {
     itdataend = itdata + numBins;
     iterrorend = iterror + numBins;
-    outputWS->dataX(i) = energies;
+    outputWS->setBinEdges(i, edges);
     if ((!std::isfinite(*itdata)) || (*itdata <= -1e10)) // masked bin
     {
       spectrumInfo.setMasked(i, true);
     } else {
-      outputWS->dataY(i) = std::vector<double>(itdata, itdataend);
-      outputWS->dataE(i) = std::vector<double>(iterror, iterrorend);
+      outputWS->mutableY(i).assign(itdata, itdataend);
+      outputWS->mutableE(i).assign(iterror, iterrorend);
     }
     itdata = (itdataend);
     iterror = (iterrorend);
diff --git a/Framework/DataHandling/src/LoadNXcanSAS.cpp b/Framework/DataHandling/src/LoadNXcanSAS.cpp
index dbfabd47a5a98d333f06bad186a48d14ebe1c9b7..a8d260ddbd1d17d1b4bbc6d0359e44ce5d3c05da 100644
--- a/Framework/DataHandling/src/LoadNXcanSAS.cpp
+++ b/Framework/DataHandling/src/LoadNXcanSAS.cpp
@@ -1,30 +1,33 @@
+#include "MantidDataHandling/LoadNXcanSAS.h"
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/Axis.h"
+#include "MantidAPI/FileFinder.h"
+#include "MantidAPI/FileProperty.h"
+#include "MantidAPI/NumericAxis.h"
 #include "MantidAPI/Progress.h"
 #include "MantidAPI/RegisterFileLoader.h"
-#include "MantidAPI/NumericAxis.h"
 #include "MantidAPI/Run.h"
 #include "MantidAPI/Workspace.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
-#include "MantidAPI/FileProperty.h"
-#include "MantidAPI/FileFinder.h"
-#include "MantidDataHandling/LoadNXcanSAS.h"
 #include "MantidDataHandling/H5Util.h"
 #include "MantidDataHandling/NXcanSASDefinitions.h"
 #include "MantidKernel/Logger.h"
-#include "MantidKernel/make_unique.h"
 #include "MantidKernel/UnitFactory.h"
+#include "MantidKernel/make_unique.h"
 
 #include <H5Cpp.h>
-#include <Poco/Path.h>
 #include <Poco/DirectoryIterator.h>
+#include <Poco/Path.h>
 #include <type_traits>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
 using namespace Mantid::DataHandling::NXcanSAS;
+using Mantid::HistogramData::HistogramX;
+using Mantid::HistogramData::HistogramY;
+using Mantid::HistogramData::HistogramE;
 
 namespace {
 
@@ -228,39 +231,31 @@ void loadData1D(H5::Group &dataGroup,
   workspace->setDistribution(true);
 
   // Load the Q value
-  Mantid::MantidVec qData =
+  workspace->mutableX(0) =
       Mantid::DataHandling::H5Util::readArray1DCoerce<double>(dataGroup,
                                                               sasDataQ);
-  auto &dataQ = workspace->dataX(0);
-  dataQ.swap(qData);
   workspace->getAxis(0)->setUnit("MomentumTransfer");
 
   // Load the I value + units
-  Mantid::MantidVec iData =
+  workspace->mutableY(0) =
       Mantid::DataHandling::H5Util::readArray1DCoerce<double>(dataGroup,
                                                               sasDataI);
-  auto &dataI = workspace->dataY(0);
-  dataI.swap(iData);
 
   auto iDataSet = dataGroup.openDataSet(sasDataI);
   auto yUnit = getUnit(iDataSet);
   workspace->setYUnit(yUnit);
 
   // Load the Idev value
-  Mantid::MantidVec iDevData =
+  workspace->mutableE(0) =
       Mantid::DataHandling::H5Util::readArray1DCoerce<double>(dataGroup,
                                                               sasDataIdev);
-  auto &dataIdev = workspace->dataE(0);
-  dataIdev.swap(iDevData);
 
   // Load the Qdev value (optional)
   bool hasQResolution = hasQDev(dataGroup);
   if (hasQResolution) {
-    Mantid::MantidVec qDevData =
-        Mantid::DataHandling::H5Util::readArray1DCoerce<double>(dataGroup,
-                                                                sasDataQdev);
-    auto &dataQdev = workspace->dataDx(0);
-    dataQdev.swap(qDevData);
+    workspace->setPointStandardDeviations(
+        0, Mantid::DataHandling::H5Util::readArray1DCoerce<double>(
+               dataGroup, sasDataQdev));
   }
 }
 
@@ -283,10 +278,14 @@ void read2DWorkspace(H5::DataSet &dataSet,
   hsize_t memSpaceDimension[1] = {dimInfo.dimBin};
   H5::DataSpace memSpace(1, memSpaceDimension);
 
+  auto &dataHist = func(workspace, 0);
+  Mantid::MantidVec data(dataHist.size());
   for (size_t index = 0; index < dimInfo.dimSpectrumAxis; ++index) {
     // Set the dataSpace to a 1D HyperSlab
     fileSpace.selectHyperslab(H5S_SELECT_SET, sizeOfSingleSlab, start);
-    dataSet.read(func(workspace, index), memoryDataType, memSpace, fileSpace);
+    dataSet.read(data.data(), memoryDataType, memSpace, fileSpace);
+    auto &dat = func(workspace, index);
+    dat = data;
     ++start[0];
   }
 }
@@ -342,9 +341,8 @@ void loadData2D(H5::Group &dataGroup,
   //-----------------------------------------
   // Load the I value.
   auto iDataSet = dataGroup.openDataSet(sasDataI);
-  auto iExtractor = [](Mantid::API::MatrixWorkspace_sptr ws, size_t index) {
-    return ws->dataY(index).data();
-  };
+  auto iExtractor = [](Mantid::API::MatrixWorkspace_sptr ws, size_t index)
+                        -> HistogramY &{ return ws->mutableY(index); };
   auto iDataType = Mantid::DataHandling::H5Util::getType<double>();
   read2DWorkspace(iDataSet, workspace, iExtractor, iDataType);
   auto yUnit = getUnit(iDataSet);
@@ -353,17 +351,15 @@ void loadData2D(H5::Group &dataGroup,
   //-----------------------------------------
   // Load the Idev value
   auto eDataSet = dataGroup.openDataSet(sasDataIdev);
-  auto eExtractor = [](Mantid::API::MatrixWorkspace_sptr ws, size_t index) {
-    return ws->dataE(index).data();
-  };
+  auto eExtractor = [](Mantid::API::MatrixWorkspace_sptr ws, size_t index)
+                        -> HistogramE &{ return ws->mutableE(index); };
   read2DWorkspace(eDataSet, workspace, eExtractor, iDataType);
 
   //-----------------------------------------
   // Load the Qx value + units
   auto qxDataSet = dataGroup.openDataSet(sasDataQx);
-  auto qxExtractor = [](Mantid::API::MatrixWorkspace_sptr ws, size_t index) {
-    return ws->dataX(index).data();
-  };
+  auto qxExtractor = [](Mantid::API::MatrixWorkspace_sptr ws, size_t index)
+                         -> HistogramX &{ return ws->mutableX(index); };
   auto qxDataType = Mantid::DataHandling::H5Util::getType<double>();
   read2DWorkspace(qxDataSet, workspace, qxExtractor, qxDataType);
   workspace->getAxis(0)->setUnit("MomentumTransfer");
@@ -427,27 +423,20 @@ void loadTransmissionData(H5::Group &transmission,
                           Mantid::API::MatrixWorkspace_sptr workspace) {
   //-----------------------------------------
   // Load T
-  Mantid::MantidVec tData =
+  workspace->mutableY(0) =
       Mantid::DataHandling::H5Util::readArray1DCoerce<double>(
           transmission, sasTransmissionSpectrumT);
-  auto &dataT = workspace->dataY(0);
-  dataT.swap(tData);
-
   //-----------------------------------------
   // Load Tdev
-  Mantid::MantidVec tDevData =
+  workspace->mutableE(0) =
       Mantid::DataHandling::H5Util::readArray1DCoerce<double>(
           transmission, sasTransmissionSpectrumTdev);
-  auto &dataTdev = workspace->dataE(0);
-  dataTdev.swap(tDevData);
-
   //-----------------------------------------
   // Load Lambda
-  Mantid::MantidVec lambdaData =
-      Mantid::DataHandling::H5Util::readArray1DCoerce<double>(
-          transmission, sasTransmissionSpectrumLambda);
-  auto &dataLambda = workspace->dataX(0);
-  dataLambda.swap(lambdaData);
+  workspace->setPoints(0,
+                       Mantid::DataHandling::H5Util::readArray1DCoerce<double>(
+                           transmission, sasTransmissionSpectrumLambda));
+
   workspace->getAxis(0)->unit() =
       Mantid::Kernel::UnitFactory::Instance().create("Wavelength");
 }
diff --git a/Framework/DataHandling/src/LoadNexusMonitors2.cpp b/Framework/DataHandling/src/LoadNexusMonitors2.cpp
index 56f28c4c96f537b46769d106d7257dd045612f90..2a988b9aeee421366a535be895a85c396646a54b 100644
--- a/Framework/DataHandling/src/LoadNexusMonitors2.cpp
+++ b/Framework/DataHandling/src/LoadNexusMonitors2.cpp
@@ -1,19 +1,19 @@
 #include "MantidDataHandling/LoadNexusMonitors2.h"
 
-#include "MantidDataHandling/LoadEventNexus.h"
-#include "MantidDataHandling/ISISRunLogs.h"
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/Sample.h"
-#include "MantidAPI/WorkspaceGroup.h"
 #include "MantidAPI/WorkspaceFactory.h"
+#include "MantidAPI/WorkspaceGroup.h"
+#include "MantidDataHandling/ISISRunLogs.h"
+#include "MantidDataHandling/LoadEventNexus.h"
 #include "MantidKernel/ConfigService.h"
 #include "MantidKernel/DateAndTime.h"
 #include "MantidKernel/UnitFactory.h"
 
-#include <boost/lexical_cast.hpp>
 #include <Poco/File.h>
 #include <Poco/Path.h>
+#include <boost/lexical_cast.hpp>
 
 #include <algorithm>
 #include <cmath>
@@ -24,6 +24,10 @@ using Mantid::DataObjects::EventWorkspace;
 using Mantid::DataObjects::EventWorkspace_sptr;
 using Mantid::API::WorkspaceGroup;
 using Mantid::API::WorkspaceGroup_sptr;
+using Mantid::HistogramData::Counts;
+using Mantid::HistogramData::CountStandardDeviations;
+using Mantid::HistogramData::BinEdges;
+using Mantid::HistogramData::Histogram;
 
 namespace Mantid {
 namespace DataHandling {
@@ -105,9 +109,9 @@ void LoadNexusMonitors2::init() {
 
 //------------------------------------------------------------------------------
 /**
- * Executes the algorithm. Reading in the file and creating and populating
- * the output workspace
- */
+* Executes the algorithm. Reading in the file and creating and populating
+* the output workspace
+*/
 void LoadNexusMonitors2::exec() {
   // Retrieve the filename from the properties
   m_filename = this->getPropertyValue("Filename");
@@ -146,6 +150,11 @@ void LoadNexusMonitors2::exec() {
       getMonitorInfo(file, monitorNames, numHistMon, numEventMon, numPeriods,
                      monitorNumber2Name, isEventMonitors);
 
+  if (numPeriods > 1) {
+    m_multiPeriodCounts.resize(m_monitor_count);
+    m_multiPeriodBinEdges.resize(m_monitor_count);
+  }
+
   // Nothing to do
   if (0 == m_monitor_count) {
     // previous version just used to return, but that
@@ -247,7 +256,7 @@ void LoadNexusMonitors2::exec() {
       readEventMonitorEntry(file, ws_index);
     } else {
       // load as a histogram monitor
-      readHistoMonitorEntry(file, ws_index);
+      readHistoMonitorEntry(file, ws_index, numPeriods);
     }
 
     file.closeGroup(); // NXmonitor
@@ -357,12 +366,12 @@ void LoadNexusMonitors2::exec() {
 
 //------------------------------------------------------------------------------
 /**
- * Can we get a histogram (non event data) for every monitor?
- *
- * @param file :: NeXus file object (open)
- * @param monitorNames :: names of monitors of interest
- * @return If there seems to be histograms for all monitors (they have "data")
- **/
+* Can we get a histogram (non event data) for every monitor?
+*
+* @param file :: NeXus file object (open)
+* @param monitorNames :: names of monitors of interest
+* @return If there seems to be histograms for all monitors (they have "data")
+**/
 bool LoadNexusMonitors2::allMonitorsHaveHistoData(
     ::NeXus::File &file, const std::vector<std::string> &monitorNames) {
   bool res = true;
@@ -383,14 +392,14 @@ bool LoadNexusMonitors2::allMonitorsHaveHistoData(
 
 //------------------------------------------------------------------------------
 /**
- * Fix the detector numbers if the defaults are not correct. Currently checks
- * the isis_vms_compat block and reads them from there if possible.
- *
- * @param det_ids :: An array of prefilled detector IDs
- * @param file :: A reference to the NeXus file opened at the root entry
- * @param spec_ids :: An array of spectrum numbers that the monitors have
- * @param nmonitors :: The size of the det_ids and spec_ids arrays
- */
+* Fix the detector numbers if the defaults are not correct. Currently checks
+* the isis_vms_compat block and reads them from there if possible.
+*
+* @param det_ids :: An array of prefilled detector IDs
+* @param file :: A reference to the NeXus file opened at the root entry
+* @param spec_ids :: An array of spectrum numbers that the monitors have
+* @param nmonitors :: The size of the det_ids and spec_ids arrays
+*/
 void LoadNexusMonitors2::fixUDets(
     boost::scoped_array<detid_t> &det_ids, ::NeXus::File &file,
     const boost::scoped_array<specnum_t> &spec_ids,
@@ -450,11 +459,11 @@ void LoadNexusMonitors2::runLoadLogs(const std::string filename,
 
 //------------------------------------------------------------------------------
 /**
- * Helper method to make sure that a file is / can be openend as a NeXus file
- *
- * @param fname :: name of the file
- * @return True if opening the file as NeXus and retrieving entries succeeds
- **/
+* Helper method to make sure that a file is / can be openend as a NeXus file
+*
+* @param fname :: name of the file
+* @return True if opening the file as NeXus and retrieving entries succeeds
+**/
 bool LoadNexusMonitors2::canOpenAsNeXus(const std::string &fname) {
   bool res = true;
   ::NeXus::File *f = nullptr;
@@ -474,11 +483,11 @@ bool LoadNexusMonitors2::canOpenAsNeXus(const std::string &fname) {
 
 //------------------------------------------------------------------------------
 /**
- * Splits multiperiod histogram data into seperate workspaces and puts them in
- * a group
- *
- * @param numPeriods :: number of periods
- **/
+* Splits multiperiod histogram data into seperate workspaces and puts them in
+* a group
+*
+* @param numPeriods :: number of periods
+**/
 void LoadNexusMonitors2::splitMutiPeriodHistrogramData(
     const size_t numPeriods) {
   // protection - we should not have entered the routine if these are not true
@@ -491,53 +500,37 @@ void LoadNexusMonitors2::splitMutiPeriodHistrogramData(
   }
 
   // Y array should be divisible by the number of periods
-  if (m_workspace->blocksize() % numPeriods != 0) {
+  if (m_multiPeriodCounts[0].size() % numPeriods != 0) {
     g_log.warning()
         << "Attempted to split multiperiod histogram workspace with "
-        << m_workspace->blocksize() << "data entries, into " << numPeriods
+        << m_multiPeriodCounts[0].size() << "data entries, into " << numPeriods
         << "periods."
            " Aborted.\n";
     return;
   }
 
   WorkspaceGroup_sptr wsGroup(new WorkspaceGroup);
-  size_t yLength = m_workspace->blocksize() / numPeriods;
+  size_t yLength = m_multiPeriodCounts[0].size() / numPeriods;
   size_t xLength = yLength + 1;
   size_t numSpectra = m_workspace->getNumberHistograms();
   ISISRunLogs monLogCreator(m_workspace->run());
+
+  BinEdges edges = m_multiPeriodBinEdges[0];
+
   for (size_t i = 0; i < numPeriods; i++) {
     // create the period workspace
     API::MatrixWorkspace_sptr wsPeriod =
         API::WorkspaceFactory::Instance().create(m_workspace, numSpectra,
                                                  xLength, yLength);
 
-    // assign x values - restart at start for all periods
-    for (size_t wsIndex = 0; wsIndex < numSpectra; wsIndex++) {
-      MantidVec &outputVec = wsPeriod->dataX(wsIndex);
-      const MantidVec &inputVec = m_workspace->readX(wsIndex);
-      for (size_t index = 0; index < xLength; index++) {
-        outputVec[index] = inputVec[index];
-      }
-    }
+    auto offset = yLength * i;
 
-    // assign y values - use the values offset by the period number
     for (size_t wsIndex = 0; wsIndex < numSpectra; wsIndex++) {
-      MantidVec &outputVec = wsPeriod->dataY(wsIndex);
-      const MantidVec &inputVec = m_workspace->readY(wsIndex);
-      for (size_t index = 0; index < yLength; index++) {
-        outputVec[index] = inputVec[(yLength * i) + index];
-      }
-    }
+      auto inYBegin = m_multiPeriodCounts[wsIndex].cbegin() + offset;
 
-    // assign E values
-    for (size_t wsIndex = 0; wsIndex < numSpectra; wsIndex++) {
-      MantidVec &outputVec = wsPeriod->dataE(wsIndex);
-      const MantidVec &inputVec = m_workspace->readE(wsIndex);
-      for (size_t index = 0; index < yLength; index++) {
-        outputVec[index] = inputVec[(yLength * i) + index];
-      }
+      wsPeriod->setHistogram(wsIndex, edges,
+                             Counts(inYBegin, inYBegin + yLength));
     }
-
     // add period logs
     monLogCreator.addPeriodLogs(static_cast<int>(i + 1),
                                 wsPeriod->mutableRun());
@@ -630,16 +623,16 @@ size_t LoadNexusMonitors2::getMonitorInfo(
 }
 
 /** Create output workspace
- * @brief LoadNexusMonitors2::createOutputWorkspace
- * @param numHistMon
- * @param numEventMon
- * @param monitorsAsEvents
- * @param monitorNames
- * @param isEventMonitors
- * @param monitorNumber2Name
- * @param loadMonitorFlags
- * @return
- */
+* @brief LoadNexusMonitors2::createOutputWorkspace
+* @param numHistMon
+* @param numEventMon
+* @param monitorsAsEvents
+* @param monitorNames
+* @param isEventMonitors
+* @param monitorNumber2Name
+* @param loadMonitorFlags
+* @return
+*/
 bool LoadNexusMonitors2::createOutputWorkspace(
     size_t numHistMon, size_t numEventMon, bool monitorsAsEvents,
     std::vector<std::string> &monitorNames, std::vector<bool> &isEventMonitors,
@@ -837,17 +830,13 @@ void LoadNexusMonitors2::readEventMonitorEntry(NeXus::File &file, size_t i) {
     event_list.setSortOrder(DataObjects::PULSETIME_SORT);
 }
 
-void LoadNexusMonitors2::readHistoMonitorEntry(NeXus::File &file, size_t i) {
+void LoadNexusMonitors2::readHistoMonitorEntry(NeXus::File &file, size_t i,
+                                               size_t numPeriods) {
   // Now, actually retrieve the necessary data
   file.openData("data");
   MantidVec data;
   file.getDataCoerce(data);
   file.closeData();
-  MantidVec error(data.size()); // create vector of correct size
-
-  // Transform errors via square root
-  std::transform(data.begin(), data.end(), error.begin(),
-                 (double (*)(double))sqrt);
 
   // Get the TOF axis
   file.openData("time_of_flight");
@@ -855,9 +844,13 @@ void LoadNexusMonitors2::readHistoMonitorEntry(NeXus::File &file, size_t i) {
   file.getDataCoerce(tof);
   file.closeData();
 
-  m_workspace->dataX(i) = tof;
-  m_workspace->dataY(i) = data;
-  m_workspace->dataE(i) = error;
+  if (numPeriods > 1) {
+    m_multiPeriodBinEdges[i] = std::move(tof);
+    m_multiPeriodCounts[i] = std::move(data);
+  } else {
+    m_workspace->setHistogram(
+        i, Histogram(BinEdges(std::move(tof)), Counts(std::move(data))));
+  }
 }
 
 } // end DataHandling
diff --git a/Framework/DataHandling/src/LoadPDFgetNFile.cpp b/Framework/DataHandling/src/LoadPDFgetNFile.cpp
index ffaca18040e9a7a37ed8a0f2cdfcf8a4d35bde4e..11ad7e1f945695cd082422987babd1552844b647 100644
--- a/Framework/DataHandling/src/LoadPDFgetNFile.cpp
+++ b/Framework/DataHandling/src/LoadPDFgetNFile.cpp
@@ -2,16 +2,16 @@
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/RegisterFileLoader.h"
-#include "MantidAPI/WorkspaceProperty.h"
 #include "MantidAPI/WorkspaceFactory.h"
+#include "MantidAPI/WorkspaceProperty.h"
 #include "MantidKernel/Unit.h"
 #include "MantidKernel/UnitFactory.h"
 
-#include <fstream>
-#include <iomanip>
 #include <boost/algorithm/string.hpp>
 #include <boost/algorithm/string/split.hpp>
 #include <boost/algorithm/string/trim.hpp>
+#include <fstream>
+#include <iomanip>
 
 using namespace Mantid;
 using namespace Mantid::Kernel;
@@ -285,33 +285,13 @@ void LoadPDFgetNFile::setUnit(Workspace2D_sptr ws) {
   ws->setYUnitLabel(ylabel);
 }
 
-/** Generate output data workspace
-  * Assumption.  One data set must contain more than 1 element.
-  */
-void LoadPDFgetNFile::generateDataWorkspace() {
-  // 0. Check
-  if (mData.empty()) {
-    throw runtime_error("Data set has not been initialized. Quit!");
-  }
-
-  // 1. Figure out direction of X and number of data set
-  bool xascend = true;
-  if (mData.size() >= 2 && mData[0][1] < mData[0][0]) {
-    xascend = false;
-  }
-
-  size_t numsets = 0;
-  vector<size_t> numptsvec;
-  size_t arraysize = mData[0].size();
-  if (arraysize <= 1) {
-    throw runtime_error("Number of columns in data is less and equal to 1.  It "
-                        "is unphysically too small.");
-  }
-
-  double prex = mData[0][0];
+size_t calcVecSize(const std::vector<double> &data0,
+                   std::vector<size_t> &numptsvec, size_t &numsets,
+                   bool xascend) {
   size_t vecsize = 1;
-  for (size_t i = 1; i < arraysize; ++i) {
-    double curx = mData[0][i];
+  auto prex = data0[0];
+  for (size_t i = 1; i < data0.size(); ++i) {
+    double curx = data0[i];
     if (((xascend) && (curx < prex)) || ((!xascend) && (curx > prex))) {
       // X in ascending order and hit the end of one set of data
       // X in descending order and hit the end of one set of data
@@ -326,10 +306,12 @@ void LoadPDFgetNFile::generateDataWorkspace() {
     // Loop variable udpate
     prex = curx;
   } // ENDFOR
-  // Record the last data set information
-  ++numsets;
-  numptsvec.push_back(vecsize);
 
+  return vecsize;
+}
+
+void LoadPDFgetNFile::checkSameSize(const std::vector<size_t> &numptsvec,
+                                    size_t numsets) {
   bool samesize = true;
   for (size_t i = 0; i < numsets; ++i) {
     if (i > 0) {
@@ -348,6 +330,37 @@ void LoadPDFgetNFile::generateDataWorkspace() {
     g_log.error() << errmsg.str() << '\n';
     throw std::runtime_error(errmsg.str());
   }
+}
+
+/** Generate output data workspace
+  * Assumption.  One data set must contain more than 1 element.
+  */
+void LoadPDFgetNFile::generateDataWorkspace() {
+  // 0. Check
+  if (mData.empty()) {
+    throw runtime_error("Data set has not been initialized. Quit!");
+  }
+
+  // 1. Figure out direction of X and number of data set
+  bool xascend = true;
+  if (mData.size() >= 2 && mData[0][1] < mData[0][0]) {
+    xascend = false;
+  }
+
+  size_t numsets = 0;
+  vector<size_t> numptsvec;
+  size_t arraysize = mData[0].size();
+  if (arraysize <= 1) {
+    throw runtime_error("Number of columns in data is less and equal to 1.  It "
+                        "is unphysically too small.");
+  }
+
+  // Record the last data set information
+  ++numsets;
+  numptsvec.push_back(calcVecSize(mData[0], numptsvec, numsets, xascend));
+
+  checkSameSize(numptsvec, numsets);
+
   size_t size = numptsvec[0];
 
   // 2. Generate workspace2D object and set the unit
@@ -360,9 +373,9 @@ void LoadPDFgetNFile::generateDataWorkspace() {
   // 3. Set number
   size_t numspec = outWS->getNumberHistograms();
   for (size_t i = 0; i < numspec; ++i) {
-    MantidVec &X = outWS->dataX(i);
-    MantidVec &Y = outWS->dataY(i);
-    MantidVec &E = outWS->dataE(i);
+    auto &X = outWS->mutableX(i);
+    auto &Y = outWS->mutableY(i);
+    auto &E = outWS->mutableE(i);
 
     size_t baseindex = i * size;
     for (size_t j = 0; j < size; ++j) {
diff --git a/Framework/DataHandling/src/LoadPreNexusMonitors.cpp b/Framework/DataHandling/src/LoadPreNexusMonitors.cpp
index 36d3d6c5d66f67afbbcbe845521d3ad2fec9c4d9..d863ef16a07be96f2b2539dc1224e4ed36963792 100644
--- a/Framework/DataHandling/src/LoadPreNexusMonitors.cpp
+++ b/Framework/DataHandling/src/LoadPreNexusMonitors.cpp
@@ -15,8 +15,8 @@
 #include <Poco/DOM/DOMParser.h>
 #include <Poco/DOM/Document.h>
 #include <Poco/DOM/Element.h>
-#include <Poco/DOM/NodeIterator.h>
 #include <Poco/DOM/NodeFilter.h>
+#include <Poco/DOM/NodeIterator.h>
 #include <Poco/DOM/NodeList.h>
 #include <Poco/Path.h>
 #include <Poco/SAX/InputSource.h>
@@ -26,6 +26,9 @@
 #include <fstream>
 #include <iterator>
 
+using Mantid::HistogramData::BinEdges;
+using Mantid::HistogramData::Counts;
+
 namespace Mantid {
 namespace DataHandling {
 
@@ -176,6 +179,7 @@ void LoadPreNexusMonitors::exec() {
   MatrixWorkspace_sptr localWorkspace = WorkspaceFactory::Instance().create(
       "Workspace2D", nMonitors, numberTimeBins, tchannels);
 
+  BinEdges edges(time_bins);
   for (int i = 0; i < nMonitors; i++) {
     // Now lets actually read the monitor files..
     Poco::Path pMonitorFilename(dirPath, monitorFilenames[i]);
@@ -187,16 +191,9 @@ void LoadPreNexusMonitors::exec() {
     // temp buffer for file reading
     std::vector<uint32_t> buffer = monitorFile.loadAllIntoVector();
 
-    MantidVec intensity(buffer.begin(), buffer.end());
-    // Copy the same data into the error array
-    MantidVec error(buffer.begin(), buffer.end());
-    // Now take the sqrt()
-    std::transform(error.begin(), error.end(), error.begin(),
-                   static_cast<double (*)(double)>(sqrt));
+    localWorkspace->setHistogram(i, edges,
+                                 Counts(buffer.begin(), buffer.end()));
 
-    localWorkspace->dataX(i) = time_bins;
-    localWorkspace->dataY(i) = intensity;
-    localWorkspace->dataE(i) = error;
     // Just have spectrum number be the same as the monitor number but -ve.
     auto &spectrum = localWorkspace->getSpectrum(i);
     spectrum.setSpectrumNo(monitorIDs[i]);
diff --git a/Framework/DataHandling/src/LoadTOFRawNexus.cpp b/Framework/DataHandling/src/LoadTOFRawNexus.cpp
index 3acf135a655ca8fa4d04fa929fb91daa52d9fbdb..10e212e5ab6543972450b4388e9d2253af4603c7 100644
--- a/Framework/DataHandling/src/LoadTOFRawNexus.cpp
+++ b/Framework/DataHandling/src/LoadTOFRawNexus.cpp
@@ -23,6 +23,9 @@ DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadTOFRawNexus)
 using namespace Kernel;
 using namespace API;
 using namespace DataObjects;
+using HistogramData::BinEdges;
+using HistogramData::Counts;
+using HistogramData::CountStandardDeviations;
 
 LoadTOFRawNexus::LoadTOFRawNexus()
     : m_numPixels(0), m_signalNo(0), pulseTimes(0), m_numBins(0), m_spec_min(0),
@@ -379,7 +382,7 @@ void LoadTOFRawNexus::loadBank(const std::string &nexusfilename,
     return;
   }
 
-  HistogramData::BinEdges X(tof.begin(), tof.end());
+  BinEdges X(tof.begin(), tof.end());
 
   // Load the data. Coerce ints into double.
   std::string errorsField;
@@ -406,13 +409,6 @@ void LoadTOFRawNexus::loadBank(const std::string &nexusfilename,
     }
   }
 
-  /*if (data.size() != m_numBins * m_numPixels)
-  { file->close(); m_fileMutex.unlock(); g_log.warning() << "Invalid size of '"
-  << m_dataField << "' data in " << bankName << '\n'; return; }
-  if (hasErrors && (errors.size() != m_numBins * m_numPixels))
-  { file->close(); m_fileMutex.unlock(); g_log.warning() << "Invalid size of '"
-  << errorsField << "' errors in " << bankName << '\n'; return; }
-*/
   // Have all the data I need
   m_fileMutex.unlock();
   file->close();
@@ -426,24 +422,16 @@ void LoadTOFRawNexus::loadBank(const std::string &nexusfilename,
     auto &spec = WS->getSpectrum(wi);
     spec.setSpectrumNo(specnum_t(wi + 1));
     spec.setDetectorID(pixel_id[i - iPart]);
-    // Set the shared X pointer
-    spec.setBinEdges(X);
-
-    // Extract the Y
-    MantidVec &Y = spec.dataY();
-    Y.assign(data.begin() + i * m_numBins, data.begin() + (i + 1) * m_numBins);
-
-    MantidVec &E = spec.dataE();
+    auto from = data.begin() + i * m_numBins;
+    auto to = from + m_numBins;
 
     if (hasErrors) {
-      // Copy the errors from the loaded document
-      E.assign(errors.begin() + i * m_numBins,
-               errors.begin() + (i + 1) * m_numBins);
+      auto eFrom = errors.begin() + i * m_numBins;
+      auto eTo = eFrom + m_numBins;
+      spec.setHistogram(X, Counts(from, to),
+                        CountStandardDeviations(eFrom, eTo));
     } else {
-      // Now take the sqrt(Y) to give E
-      E = MantidVec();
-      std::transform(Y.begin(), Y.end(), std::back_inserter(E),
-                     static_cast<double (*)(double)>(sqrt));
+      spec.setHistogram(X, Counts(from, to));
     }
   }
 
diff --git a/Framework/DataHandling/src/LoadVulcanCalFile.cpp b/Framework/DataHandling/src/LoadVulcanCalFile.cpp
index 5e9bfe7d1d85eeab8a49d924d950eaaffdc0ccb5..aa7a7e8fe2b8888763a17ddec295157705d3ac96 100644
--- a/Framework/DataHandling/src/LoadVulcanCalFile.cpp
+++ b/Framework/DataHandling/src/LoadVulcanCalFile.cpp
@@ -2,23 +2,23 @@
 #include "MantidAPI/Algorithm.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/MatrixWorkspace.h"
-#include "MantidAPI/SpectrumInfo.h"
 #include "MantidAPI/Run.h"
+#include "MantidAPI/SpectrumInfo.h"
 #include "MantidDataObjects/GroupingWorkspace.h"
 #include "MantidDataObjects/MaskWorkspace.h"
 #include "MantidDataObjects/OffsetsWorkspace.h"
 #include "MantidDataObjects/Workspace2D.h"
-#include "MantidKernel/System.h"
-#include "MantidKernel/ListValidator.h"
 #include "MantidKernel/ArrayProperty.h"
-#include <fstream>
+#include "MantidKernel/ListValidator.h"
+#include "MantidKernel/System.h"
 #include <Poco/Path.h>
+#include <fstream>
 
-#include <sstream>
 #include <fstream>
+#include <sstream>
 
-#include <boost/algorithm/string/trim.hpp>
 #include <boost/algorithm/string/split.hpp>
+#include <boost/algorithm/string/trim.hpp>
 
 using Mantid::Geometry::Instrument_const_sptr;
 using namespace Mantid::Kernel;
@@ -291,11 +291,11 @@ void LoadVulcanCalFile::setupMaskWorkspace() {
   std::ostringstream msg;
   auto &spectrumInfo = m_maskWS->mutableSpectrumInfo();
   for (size_t i = 0; i < m_maskWS->getNumberHistograms(); ++i) {
-    if (m_maskWS->readY(i)[0] > 0.5) {
+    if (m_maskWS->y(i)[0] > 0.5) {
       m_maskWS->getSpectrum(i).clearData();
       spectrumInfo.setMasked(i, true);
-      m_maskWS->dataY(i)[0] = 1.0;
-      msg << "Spectrum " << i << " is masked. DataY = " << m_maskWS->readY(i)[0]
+      m_maskWS->mutableY(i)[0] = 1.0;
+      msg << "Spectrum " << i << " is masked. DataY = " << m_maskWS->y(i)[0]
           << "\n";
     }
   }
@@ -468,7 +468,7 @@ void LoadVulcanCalFile::processOffsets(
       throw runtime_error("It cannot happen!");
 
     double offset = offsetiter->second + bankcorriter->second;
-    m_tofOffsetsWS->dataY(iws)[0] = pow(10., offset);
+    m_tofOffsetsWS->mutableY(iws)[0] = pow(10., offset);
   }
 }
 
@@ -486,7 +486,7 @@ void LoadVulcanCalFile::alignEventWorkspace() {
     PARALLEL_START_INTERUPT_REGION
 
     // Compute the conversion factor
-    double factor = m_tofOffsetsWS->readY(i)[0];
+    double factor = m_tofOffsetsWS->y(i)[0];
 
     // Perform the multiplication on all events
     m_eventWS->getSpectrum(i).convertTof(1. / factor);
@@ -559,11 +559,11 @@ void LoadVulcanCalFile::convertOffsets() {
     double totL = l1 + l2;
 
     // Calcualte converted offset
-    double vuloffset = m_tofOffsetsWS->readY(iws)[0];
+    double vuloffset = m_tofOffsetsWS->y(iws)[0];
     double manoffset = (totL * sin(twotheta * 0.5 * M_PI / 180.)) /
                            (effL * sin(effTheta * M_PI / 180.)) / vuloffset -
                        1.;
-    m_offsetsWS->dataY(iws)[0] = manoffset;
+    m_offsetsWS->mutableY(iws)[0] = manoffset;
   }
 }
 
@@ -682,10 +682,10 @@ void LoadVulcanCalFile::readCalFile(const std::string &calFileName,
           // Not selected, then mask this detector
           maskWS->getSpectrum(wi).clearData();
           maskSpectrumInfo->setMasked(wi, true);
-          maskWS->dataY(wi)[0] = 1.0;
+          maskWS->mutableY(wi)[0] = 1.0;
         } else {
           // Selected, set the value to be 0
-          maskWS->dataY(wi)[0] = 0.0;
+          maskWS->mutableY(wi)[0] = 0.0;
           if (!hasUnmasked)
             hasUnmasked = true;
         }
diff --git a/Framework/DataHandling/src/MaskDetectors.cpp b/Framework/DataHandling/src/MaskDetectors.cpp
index 7ffcbb0625785febc015450fbb1a9b2b5d33d836..9cf919e6a1d8aa138723b6ee217b005d75506670 100644
--- a/Framework/DataHandling/src/MaskDetectors.cpp
+++ b/Framework/DataHandling/src/MaskDetectors.cpp
@@ -8,8 +8,8 @@
 #include "MantidKernel/ArrayProperty.h"
 #include "MantidKernel/BoundedValidator.h"
 #include "MantidKernel/EnabledWhenProperty.h"
-#include <set>
 #include <numeric>
+#include <set>
 
 namespace { // declare file scoped function
 /** internal method copies values in specified range from source list to the
@@ -370,7 +370,7 @@ void MaskDetectors::extractMaskedWSDetIDs(
 
   int64_t nHist = maskWS->getNumberHistograms();
   for (int64_t i = 0; i < nHist; ++i) {
-    if (maskWS->readY(i)[0] > 0.5) {
+    if (maskWS->y(i)[0] > 0.5) {
 
       try {
         const auto dets = maskWS->getSpectrum(i).getDetectorIDs();
@@ -573,7 +573,7 @@ void MaskDetectors::appendToIndexListFromMaskWS(
     constrainIndexInRange(indexList, tmp_index, startIndex, endIndex);
 
     for (size_t i = startIndex; i <= endIndex; ++i) {
-      if (maskedWorkspace->dataY(i)[0] > 0.5) {
+      if (maskedWorkspace->y(i)[0] > 0.5) {
         g_log.debug() << "Adding WorkspaceIndex " << i << " to mask.\n";
         tmp_index.push_back(i);
       }
@@ -583,7 +583,7 @@ void MaskDetectors::appendToIndexListFromMaskWS(
     endIndex = maskedWorkspace->getNumberHistograms();
     for (size_t i = 0; i < endIndex; ++i) {
 
-      if (maskedWorkspace->dataY(i)[0] > 0.5) {
+      if (maskedWorkspace->y(i)[0] > 0.5) {
         g_log.debug() << "Adding WorkspaceIndex " << i << " to mask.\n";
         tmp_index.push_back(i);
       }
diff --git a/Framework/DataHandling/src/SaveAscii.cpp b/Framework/DataHandling/src/SaveAscii.cpp
index 566f94670b459885162259023945000ef9253ad7..b53abdd4e591ebf17101b56977a2807d48fec057 100644
--- a/Framework/DataHandling/src/SaveAscii.cpp
+++ b/Framework/DataHandling/src/SaveAscii.cpp
@@ -2,17 +2,17 @@
 // Includes
 //----------------------------------------------------------------------
 #include "MantidDataHandling/SaveAscii.h"
-#include "MantidKernel/UnitFactory.h"
-#include "MantidKernel/ArrayProperty.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidKernel/ArrayProperty.h"
 #include "MantidKernel/BoundedValidator.h"
-#include "MantidKernel/VisibleWhenProperty.h"
 #include "MantidKernel/ListValidator.h"
+#include "MantidKernel/UnitFactory.h"
+#include "MantidKernel/VisibleWhenProperty.h"
 
-#include <set>
-#include <fstream>
 #include <boost/tokenizer.hpp>
+#include <fstream>
+#include <set>
 
 namespace Mantid {
 namespace DataHandling {
@@ -192,8 +192,6 @@ void SaveAscii::exec() {
     file << '\n';
   }
 
-  bool isHistogram = ws->isHistogramData();
-
   // Set the number precision
   int prec = getProperty("Precision");
   if (prec != EMPTY_INT())
@@ -201,28 +199,23 @@ void SaveAscii::exec() {
 
   Progress progress(this, 0, 1, nBins);
   auto pointDeltas = ws->pointStandardDeviations(0);
+  auto points = ws->points(0);
   for (int bin = 0; bin < nBins; bin++) {
-    if (isHistogram) // bin centres
-    {
-      file << (ws->readX(0)[bin] + ws->readX(0)[bin + 1]) / 2;
-    } else // data points
-    {
-      file << ws->readX(0)[bin];
-    }
+    file << points[bin];
 
     if (idx.empty())
       for (int spec = 0; spec < nSpectra; spec++) {
         file << sep;
-        file << ws->readY(spec)[bin];
+        file << ws->y(spec)[bin];
         file << sep;
-        file << ws->readE(spec)[bin];
+        file << ws->e(spec)[bin];
       }
     else
       for (auto spec : idx) {
         file << sep;
-        file << ws->readY(spec)[bin];
+        file << ws->y(spec)[bin];
         file << sep;
-        file << ws->readE(spec)[bin];
+        file << ws->e(spec)[bin];
       }
 
     if (write_dx) {
diff --git a/Framework/DataHandling/src/SaveAscii2.cpp b/Framework/DataHandling/src/SaveAscii2.cpp
index 796282ecf54575de2ce0547ffeff1ebf90339dd3..e1c8f77e98459ceee0f7a89da2bd8d24b9857989 100644
--- a/Framework/DataHandling/src/SaveAscii2.cpp
+++ b/Framework/DataHandling/src/SaveAscii2.cpp
@@ -1,10 +1,10 @@
-#include <set>
 #include <fstream>
+#include <set>
 
-#include "MantidDataHandling/SaveAscii2.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/SpectrumInfo.h"
+#include "MantidDataHandling/SaveAscii2.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidKernel/ArrayProperty.h"
 #include "MantidKernel/BoundedValidator.h"
@@ -14,8 +14,8 @@
 #include "MantidKernel/VectorHelper.h"
 #include "MantidKernel/VisibleWhenProperty.h"
 
-#include <boost/tokenizer.hpp>
 #include <boost/regex.hpp>
+#include <boost/tokenizer.hpp>
 
 namespace Mantid {
 namespace DataHandling {
@@ -28,7 +28,7 @@ using namespace API;
 /// Empty constructor
 SaveAscii2::SaveAscii2()
     : m_separatorIndex(), m_nBins(0), m_sep(), m_writeDX(false),
-      m_writeID(false), m_isHistogram(false), m_isCommonBins(false), m_ws() {}
+      m_writeID(false), m_isCommonBins(false), m_ws() {}
 
 /// Initialisation method.
 void SaveAscii2::init() {
@@ -123,7 +123,6 @@ void SaveAscii2::exec() {
   m_ws = getProperty("InputWorkspace");
   int nSpectra = static_cast<int>(m_ws->getNumberHistograms());
   m_nBins = static_cast<int>(m_ws->blocksize());
-  m_isHistogram = m_ws->isHistogramData();
   m_isCommonBins = m_ws->isCommonBins(); // checking for ragged workspace
   m_writeID = getProperty("WriteSpectrumID");
   std::string metaDataString = getPropertyValue("SpectrumMetaData");
@@ -298,27 +297,20 @@ void SaveAscii2::writeSpectra(const std::set<int>::const_iterator &spectraItr,
   file << '\n';
 
   auto pointDeltas = m_ws->pointStandardDeviations(0);
+  auto points0 = m_ws->points(0);
+  auto pointsSpec = m_ws->points(*spectraItr);
   for (int bin = 0; bin < m_nBins; bin++) {
     if (!m_isCommonBins) // checking for ragged workspace
     {
-      file << (m_ws->readX(*spectraItr)[bin] +
-               m_ws->readX(*spectraItr)[bin + 1]) /
-                  2;
-    }
-
-    else if (m_isHistogram & m_isCommonBins) // bin centres,
-    {
-      file << (m_ws->readX(0)[bin] + m_ws->readX(0)[bin + 1]) / 2;
-    }
-
-    else {
-      file << m_ws->readX(0)[bin];
+      file << pointsSpec[bin];
+    } else {
+      file << points0[bin];
     }
     file << m_sep;
-    file << m_ws->readY(*spectraItr)[bin];
+    file << m_ws->y(*spectraItr)[bin];
 
     file << m_sep;
-    file << m_ws->readE(*spectraItr)[bin];
+    file << m_ws->e(*spectraItr)[bin];
     if (m_writeDX) {
       file << m_sep;
       file << pointDeltas[bin];
@@ -344,24 +336,20 @@ void SaveAscii2::writeSpectra(const int &spectraIndex, std::ofstream &file) {
   file << '\n';
 
   auto pointDeltas = m_ws->pointStandardDeviations(0);
+  auto points0 = m_ws->points(0);
+  auto pointsSpec = m_ws->points(spectraIndex);
   for (int bin = 0; bin < m_nBins; bin++) {
-    if (m_isHistogram & m_isCommonBins) // bin centres,
-    {
-      file << (m_ws->readX(0)[bin] + m_ws->readX(0)[bin + 1]) / 2;
-    } else if (!m_isCommonBins) // checking for ragged workspace
-    {
-      file << (m_ws->readX(spectraIndex)[bin] +
-               m_ws->readX(spectraIndex)[bin + 1]) /
-                  2;
-    } else // data points
+    if (m_isCommonBins) {
+      file << points0[bin];
+    } else // checking for ragged workspace
     {
-      file << m_ws->readX(0)[bin];
+      file << pointsSpec[bin];
     }
     file << m_sep;
-    file << m_ws->readY(spectraIndex)[bin];
+    file << m_ws->y(spectraIndex)[bin];
 
     file << m_sep;
-    file << m_ws->readE(spectraIndex)[bin];
+    file << m_ws->e(spectraIndex)[bin];
     if (m_writeDX) {
       file << m_sep;
       file << pointDeltas[bin];
diff --git a/Framework/DataHandling/src/SaveCSV.cpp b/Framework/DataHandling/src/SaveCSV.cpp
index d4ec94836026b51923a0731bc7b5deb90494071a..1cbbd77d9775c835fc2236adcd8ba04cc212da30 100644
--- a/Framework/DataHandling/src/SaveCSV.cpp
+++ b/Framework/DataHandling/src/SaveCSV.cpp
@@ -20,8 +20,8 @@
  */
 
 #include "MantidDataHandling/SaveCSV.h"
-#include "MantidDataObjects/Workspace2D.h"
 #include "MantidAPI/FileProperty.h"
+#include "MantidDataObjects/Workspace2D.h"
 
 #include <fstream> // used to get ofstream
 #include <iomanip>
@@ -126,7 +126,7 @@ void SaveCSV::exec() {
 
     // Add first x-axis line to output file
     {
-      const MantidVec &xValue = localworkspace->readX(0);
+      auto &xValue = localworkspace->x(0);
 
       outCSV_File << "A";
 
@@ -142,10 +142,10 @@ void SaveCSV::exec() {
       // check if x-axis has changed. If yes print out new x-axis line
 
       if (i > 0) {
-        const MantidVec &xValue = localworkspace->readX(i);
-        const MantidVec &xValuePrevious = localworkspace->readX(i - 1);
+        auto &xValue = localworkspace->x(i);
+        auto &xValuePrevious = localworkspace->x(i - 1);
 
-        if (xValue != xValuePrevious) {
+        if (xValue.rawData() != xValuePrevious.rawData()) {
           outCSV_File << "A";
 
           for (double j : xValue) {
@@ -158,7 +158,7 @@ void SaveCSV::exec() {
 
       // add y-axis line for histogram (detector) i
 
-      const MantidVec &yValue = localworkspace->dataY(i);
+      auto &yValue = localworkspace->y(i);
 
       outCSV_File << i;
 
@@ -174,7 +174,7 @@ void SaveCSV::exec() {
     outCSV_File << "\nERRORS\n";
 
     for (size_t i = 0; i < numberOfHist; i++) {
-      const MantidVec &eValue = localworkspace->dataE(i);
+      auto &eValue = localworkspace->e(i);
 
       outCSV_File << i;
 
diff --git a/Framework/DataHandling/src/SaveCanSAS1D.cpp b/Framework/DataHandling/src/SaveCanSAS1D.cpp
index a5c568833fb8d526c7dab603080b011e6ce2fca8..ff0ef0fd2649ea5c57361b0d59dd93e615b02051 100644
--- a/Framework/DataHandling/src/SaveCanSAS1D.cpp
+++ b/Framework/DataHandling/src/SaveCanSAS1D.cpp
@@ -4,17 +4,17 @@
 #include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
 
-#include "MantidGeometry/Instrument.h"
 #include "MantidGeometry/IComponent.h"
+#include "MantidGeometry/Instrument.h"
 
 #include "MantidKernel/BoundedValidator.h"
 #include "MantidKernel/Exception.h"
-#include "MantidKernel/MantidVersion.h"
 #include "MantidKernel/ListValidator.h"
+#include "MantidKernel/MantidVersion.h"
 
-#include <boost/shared_ptr.hpp>
 #include <boost/algorithm/string/split.hpp>
 #include <boost/algorithm/string/trim.hpp>
+#include <boost/shared_ptr.hpp>
 
 namespace {
 void encode(std::string &data) {
@@ -439,8 +439,8 @@ void SaveCanSAS1D::createSASDataElement(std::string &sasData) {
     if (!intensityDeltas)
       intensityDeltas =
           HistogramData::PointStandardDeviations(intensities.size(), 0.0);
-    const MantidVec &ydata = m_workspace->readY(i);
-    const MantidVec &edata = m_workspace->readE(i);
+    auto &ydata = m_workspace->y(i);
+    auto &edata = m_workspace->e(i);
     for (size_t j = 0; j < m_workspace->blocksize(); ++j) {
       // x data is the QData in xml.If histogramdata take the mean
       std::stringstream x;
diff --git a/Framework/DataHandling/src/SaveCanSAS1D2.cpp b/Framework/DataHandling/src/SaveCanSAS1D2.cpp
index 689835a681105e8440ee6cf64f8c47f466653148..cc90d47b28a2eec0929d25e764aae21129cc749a 100644
--- a/Framework/DataHandling/src/SaveCanSAS1D2.cpp
+++ b/Framework/DataHandling/src/SaveCanSAS1D2.cpp
@@ -1,8 +1,8 @@
+#include "MantidDataHandling/SaveCanSAS1D2.h"
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
-#include "MantidDataHandling/SaveCanSAS1D2.h"
 #include "MantidGeometry/IComponent.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidKernel/Exception.h"
@@ -163,13 +163,12 @@ void SaveCanSAS1D2::createSASTransElement(std::string &sasTrans,
   if (lambda_unit.empty() || lambda_unit == "Angstrom")
     lambda_unit = "A";
 
-  const MantidVec &xdata = m_ws->readX(0);
-  const MantidVec &ydata = m_ws->readY(0);
-  const MantidVec &edata = m_ws->readE(0);
-  const bool isHistogram = m_ws->isHistogramData();
+  auto xdata = m_ws->points(0);
+  auto &ydata = m_ws->y(0);
+  auto &edata = m_ws->e(0);
   for (size_t j = 0; j < m_ws->blocksize(); ++j) {
     // x data is the Lambda in xml. If histogramdata take the mean
-    double lambda = isHistogram ? (xdata[j] + xdata[j + 1]) / 2 : xdata[j];
+    double lambda = xdata[j];
     // y data is the T in xml.
     double trans_value = ydata[j];
     // e data is the Tdev in xml.
diff --git a/Framework/DataHandling/src/SaveDaveGrp.cpp b/Framework/DataHandling/src/SaveDaveGrp.cpp
index 86173effafd0a2a644478a2c120abd8f4fef1551..1cebd1eb363eb1d0107937c6d85ece577dfde331 100644
--- a/Framework/DataHandling/src/SaveDaveGrp.cpp
+++ b/Framework/DataHandling/src/SaveDaveGrp.cpp
@@ -1,8 +1,8 @@
 #include "MantidDataHandling/SaveDaveGrp.h"
-#include "MantidKernel/System.h"
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidKernel/System.h"
 #include "MantidKernel/Unit.h"
 #include "MantidKernel/UnitFactory.h"
 #include <fstream>
@@ -40,7 +40,6 @@ void SaveDaveGrp::exec() {
   if (nSpectra * nBins == 0)
     throw std::invalid_argument(
         "Either the number of bins or the number of histograms is 0");
-  bool isHist = ws->isHistogramData();
   std::string xcaption = ws->getAxis(0)->unit()->caption();
   std::string ycaption = ws->getAxis(1)->unit()->caption();
   if (xcaption.length() == 0)
@@ -75,9 +74,9 @@ void SaveDaveGrp::exec() {
   if (xToMicroeV)
     xunit = "micro eV";
   file << "# " << xcaption << " (" << xunit << ") values\n";
-  std::vector<double> x = ws->readX(0);
+  auto x = ws->points(0);
   for (std::size_t i = 0; i < nBins; i++) {
-    double xvalue = (isHist) ? (x[i] + x[i + 1]) * 0.5 : x[i];
+    double xvalue = x[i];
     if (xToMicroeV)
       xvalue *= 1000.;
     file << xvalue << '\n';
@@ -105,10 +104,13 @@ void SaveDaveGrp::exec() {
   Progress progress(this, 0, 1, nSpectra);
   for (std::size_t i = 0; i < nSpectra; i++) {
     file << "# Group " << i << '\n';
-    std::vector<double> y = ws->readY(i), er = ws->readE(i);
-    std::vector<double>::iterator ity, iter;
-    for (ity = y.begin(), iter = er.begin(); ity != y.end(); ++ity, ++iter)
-      file << (*ity) << " " << (*iter) << '\n';
+    auto &Y = ws->y(i);
+    auto &E = ws->e(i);
+    auto itE = E.cbegin();
+    std::for_each(Y.cbegin(), Y.cend(), [&itE, &file](const double y) {
+      file << y << " " << *itE++ << "\n";
+    });
+
     progress.report();
   }
   file.close();
diff --git a/Framework/DataHandling/src/SaveDspacemap.cpp b/Framework/DataHandling/src/SaveDspacemap.cpp
index 92352c01a35ae5051c37b8b0e2ca419bc389d8f5..0afa62d1289f3dbd185198cb2202bbadeb369ab9 100644
--- a/Framework/DataHandling/src/SaveDspacemap.cpp
+++ b/Framework/DataHandling/src/SaveDspacemap.cpp
@@ -1,6 +1,7 @@
 #include "MantidDataHandling/SaveDspacemap.h"
 #include "MantidDataObjects/OffsetsWorkspace.h"
 #include "MantidKernel/System.h"
+#include "MantidAPI/DetectorInfo.h"
 #include "MantidAPI/FileProperty.h"
 #include <fstream>
 
@@ -54,6 +55,7 @@ void SaveDspacemap::CalculateDspaceFromCal(
   const char *filename = DFileName.c_str();
   // Get a pointer to the instrument contained in the workspace
   Instrument_const_sptr instrument = offsetsWS->getInstrument();
+  const auto &detectorInfo = offsetsWS->detectorInfo();
   double l1;
   Kernel::V3D beamline, samplePos;
   double beamline_norm;
@@ -70,6 +72,7 @@ void SaveDspacemap::CalculateDspaceFromCal(
     if (detectorID > maxdetID)
       maxdetID = detectorID;
   }
+
   detid_t paddetID = detid_t(getProperty("PadDetID"));
   if (maxdetID < paddetID)
     maxdetID = paddetID;
@@ -86,9 +89,10 @@ void SaveDspacemap::CalculateDspaceFromCal(
     it = allDetectors.find(i);
     if (it != allDetectors.end()) {
       det = it->second;
-      factor = Instrument::calcConversion(l1, beamline, beamline_norm,
-                                          samplePos, det->getPos(),
-                                          offsetsWS->getValue(i, 0.0));
+      const auto detectorIndex = detectorInfo.indexOf(i);
+      factor = Mantid::Geometry::Conversion::tofToDSpacingFactor(
+          l1, detectorInfo.l2(detectorIndex),
+          detectorInfo.twoTheta(detectorIndex), offsetsWS->getValue(i, 0.0));
       // Factor of 10 between ISAW and Mantid
       factor *= 0.1;
       if (factor < 0)
diff --git a/Framework/DataHandling/src/SetScalingPSD.cpp b/Framework/DataHandling/src/SetScalingPSD.cpp
index 090730a47695c6770c33d7f8bed9d9ed25eeba61..9853c45bfcac8898a7e1a991c449ba6dabe073a6 100644
--- a/Framework/DataHandling/src/SetScalingPSD.cpp
+++ b/Framework/DataHandling/src/SetScalingPSD.cpp
@@ -225,66 +225,48 @@ bool SetScalingPSD::processScalingFile(const std::string &scalingFile,
   return true;
 }
 
+/**
+ * Move all the detectors to their actual positions, as stored in posMap and set
+ * their scaling as in scaleMap
+ * @param WS :: pointer to the workspace
+ * @param posMap :: A map of integer detector ID to position shift
+ * @param scaleMap :: A map of integer detectorID to scaling (in Y)
+ */
 void SetScalingPSD::movePos(API::MatrixWorkspace_sptr &WS,
                             std::map<int, Kernel::V3D> &posMap,
                             std::map<int, double> &scaleMap) {
 
-  /** Move all the detectors to their actual positions, as stored in posMap and
-  *   set their scaling as in scaleMap
-  *   @param WS :: pointer to the workspace
-  *   @param posMap :: A map of integer detector ID and corresponding position
-  * shift
-  *   @param scaleMap :: A map of integer detectorID and corresponding scaling
-  * (in Y)
-  */
-  auto iter = posMap.begin();
   Geometry::ParameterMap &pmap = WS->instrumentParameters();
-  boost::shared_ptr<const Instrument> inst = WS->getInstrument();
-  boost::shared_ptr<const IComponent> comp;
-
-  // Want to get all the detectors to move, but don't want to do this one at a
-  // time
-  // since the search (based on MoveInstrument findBy methods) is going to be
-  // too slow
-  // Hence findAll gets a vector of IComponent for all detectors, as m_vectDet.
-  m_vectDet.reserve(posMap.size());
-  findAll(inst);
+  auto &detectorInfo = WS->mutableDetectorInfo();
 
-  double scale, maxScale = -1e6, minScale = 1e6, aveScale = 0.0;
+  double maxScale = -1e6, minScale = 1e6, aveScale = 0.0;
   int scaleCount = 0;
-  // progress 50% here inside the for loop
-  // double prog=0.5;
-  Progress prog(this, 0.5, 1.0, static_cast<int>(m_vectDet.size()));
-  // loop over detector (IComps)
-  for (auto &id : m_vectDet) {
-    comp = id;
-    boost::shared_ptr<const IDetector> det =
-        boost::dynamic_pointer_cast<const IDetector>(comp);
-    int idet = 0;
-    if (det)
-      idet = det->getID();
+  Progress prog(this, 0.5, 1.0, static_cast<int>(detectorInfo.size()));
+
+  for (size_t i = 0; i < detectorInfo.size(); ++i) {
+    int idet = detectorInfo.detectorIDs()[i];
 
-    iter = posMap.find(idet); // check if we have a shift
-    if (iter == posMap.end())
+    // Check if we have a shift, else do nothing.
+    auto itPos = posMap.find(idet);
+    if (itPos == posMap.end())
       continue;
-    Geometry::ComponentHelper::moveComponent(
-        *det, pmap, iter->second, Geometry::ComponentHelper::Relative);
+
+    // Do a relative move
+    const auto newPosition = detectorInfo.position(i) + itPos->second;
+    detectorInfo.setPosition(i, newPosition);
 
     // Set the "sca" instrument parameter
-    auto it = scaleMap.find(idet);
-    if (it != scaleMap.end()) {
-      scale = it->second;
+    auto itScale = scaleMap.find(idet);
+    if (itScale != scaleMap.end()) {
+      const double scale = itScale->second;
       if (minScale > scale)
         minScale = scale;
       if (maxScale < scale)
         maxScale = scale;
       aveScale += fabs(1.0 - scale);
       scaleCount++;
-      pmap.addV3D(comp.get(), "sca", V3D(1.0, it->second, 1.0));
+      pmap.addV3D(&detectorInfo.detector(i), "sca", V3D(1.0, scale, 1.0));
     }
-    //
-    // prog+= double(1)/m_vectDet.size();
-    // progress(prog);
     prog.report();
   }
   g_log.debug() << "Range of scaling factors is " << minScale << " to "
@@ -299,25 +281,6 @@ void SetScalingPSD::movePos(API::MatrixWorkspace_sptr &WS,
   }
 }
 
-/** Find all detectors in the comp and push the IComp pointers onto m_vectDet
- * @param comp :: The component to search
- */
-void SetScalingPSD::findAll(
-    boost::shared_ptr<const Geometry::IComponent> comp) {
-  boost::shared_ptr<const IDetector> det =
-      boost::dynamic_pointer_cast<const IDetector>(comp);
-  if (det) {
-    m_vectDet.push_back(comp);
-    return;
-  }
-  auto asmb = boost::dynamic_pointer_cast<const ICompAssembly>(comp);
-  if (asmb) {
-    for (int i = 0; i < asmb->nelements(); i++) {
-      findAll((*asmb)[i]);
-    }
-  }
-}
-
 /** Read detector true positions from raw file
  * @param rawfile :: Name of raw file
  * @param detID :: Vector of detector numbers
diff --git a/Framework/DataHandling/test/ExtractMonitorWorkspaceTest.h b/Framework/DataHandling/test/ExtractMonitorWorkspaceTest.h
index fa7a6ee512f5f098170af80857116e6b6cbd76c4..5c5abbc5af8e2c47c9824cb020237d27929590a4 100644
--- a/Framework/DataHandling/test/ExtractMonitorWorkspaceTest.h
+++ b/Framework/DataHandling/test/ExtractMonitorWorkspaceTest.h
@@ -29,7 +29,7 @@ public:
   }
 
   void test_fails_if_no_monitor_workspace() {
-    auto inws = WorkspaceCreationHelper::create1DWorkspaceRand(1);
+    auto inws = WorkspaceCreationHelper::create1DWorkspaceRand(1, true);
 
     ExtractMonitorWorkspace alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
@@ -77,8 +77,8 @@ public:
   }
 
   void test_2D_2D() {
-    auto inws = WorkspaceCreationHelper::create1DWorkspaceRand(1);
-    auto monws = WorkspaceCreationHelper::create1DWorkspaceFib(1);
+    auto inws = WorkspaceCreationHelper::create1DWorkspaceRand(1, true);
+    auto monws = WorkspaceCreationHelper::create1DWorkspaceFib(1, true);
     doTest(inws, monws);
   }
 
@@ -86,14 +86,14 @@ public:
   // type
 
   void test_2D_event() {
-    auto inws = WorkspaceCreationHelper::create1DWorkspaceRand(1);
+    auto inws = WorkspaceCreationHelper::create1DWorkspaceRand(1, true);
     auto monws = WorkspaceCreationHelper::createEventWorkspace2(1, 1);
     doTest(inws, monws);
   }
 
   void test_event_2D() {
     auto inws = WorkspaceCreationHelper::createEventWorkspace2(1, 1);
-    auto monws = WorkspaceCreationHelper::create1DWorkspaceRand(1);
+    auto monws = WorkspaceCreationHelper::create1DWorkspaceRand(1, true);
     doTest(inws, monws);
   }
 
diff --git a/Framework/DataHandling/test/LoadDspacemapTest.h b/Framework/DataHandling/test/LoadDspacemapTest.h
index 436509e27c298a9ae1478dd5d06deeaa03311cde..af0a6f9b94944934b77ba7268c6f8252f7d717a0 100644
--- a/Framework/DataHandling/test/LoadDspacemapTest.h
+++ b/Framework/DataHandling/test/LoadDspacemapTest.h
@@ -38,7 +38,7 @@ public:
     fout.close();
     testerDSP.setPropertyValue("Filename", dspaceFile);
     testerDSP.setPropertyValue("OutputWorkspace", "ines_offsets");
-    TS_ASSERT_THROWS_NOTHING(testerDSP.execute());
+    testerDSP.execute();
     TS_ASSERT(testerDSP.isExecuted());
 
     // Get the offsets out
diff --git a/Framework/DataHandling/test/LoadMLZTest.h b/Framework/DataHandling/test/LoadMLZTest.h
index b9776299a03d666d64f2007434f37ed5d255f9bb..6885c75f3e9a689230c4f3ff2901da0c14e338a7 100644
--- a/Framework/DataHandling/test/LoadMLZTest.h
+++ b/Framework/DataHandling/test/LoadMLZTest.h
@@ -1,10 +1,10 @@
 #ifndef LOADMLZTEST_H_
 #define LOADMLZTEST_H_
 
-#include <cxxtest/TestSuite.h>
-#include "MantidDataHandling/LoadMLZ.h"
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidDataHandling/LoadMLZ.h"
+#include <cxxtest/TestSuite.h>
 
 using namespace Mantid::API;
 using Mantid::DataHandling::LoadMLZ;
@@ -69,15 +69,24 @@ class LoadMLZTestPerformance : public CxxTest::TestSuite {
 public:
   LoadMLZTestPerformance() : m_dataFile("TOFTOFTestdata.nxs") {}
 
-  void testDefaultLoad() {
-    Mantid::DataHandling::LoadMLZ loader;
+  static LoadMLZTestPerformance *createSuite() {
+    return new LoadMLZTestPerformance();
+  }
+
+  static void destroySuite(LoadMLZTestPerformance *suite) { delete suite; }
+
+  void setUp() override {
     loader.initialize();
     loader.setPropertyValue("Filename", m_dataFile);
     loader.setPropertyValue("OutputWorkspace", "ws");
-    TS_ASSERT(loader.execute());
   }
 
+  void tearDown() override { AnalysisDataService::Instance().remove("ws"); }
+
+  void testDefaultLoad() { loader.execute(); }
+
 private:
+  Mantid::DataHandling::LoadMLZ loader;
   std::string m_dataFile;
 };
 
diff --git a/Framework/DataHandling/test/LoadMcStasNexusTest.h b/Framework/DataHandling/test/LoadMcStasNexusTest.h
index 36a36c38722887a2749355508b72829184dc8107..5e643700f21c9ef753079590a127fe254a848669 100644
--- a/Framework/DataHandling/test/LoadMcStasNexusTest.h
+++ b/Framework/DataHandling/test/LoadMcStasNexusTest.h
@@ -1,19 +1,19 @@
 #ifndef LOADMCSTASNEXUSTEST_H_
 #define LOADMCSTASNEXUSTEST_H_
 
-#include <fstream>
 #include <cxxtest/TestSuite.h>
+#include <fstream>
 
+#include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/WorkspaceFactory.h"
-#include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/WorkspaceGroup.h"
 #include "MantidDataHandling/LoadMcStasNexus.h"
 // These includes seem to make the difference between initialization of the
 // workspace names (workspace2D/1D etc), instrument classes and not for this
 // test case.
-#include "MantidDataObjects/WorkspaceSingleValue.h"
 #include "MantidDataHandling/LoadInstrument.h"
+#include "MantidDataObjects/WorkspaceSingleValue.h"
 #include <Poco/Path.h>
 
 using namespace Mantid::API;
@@ -63,6 +63,9 @@ public:
         AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
             outputSpace + "_2");
     TS_ASSERT_EQUALS(outputItem2->getNumberHistograms(), 128);
+
+    AnalysisDataService::Instance().remove(outputSpace + "_1");
+    AnalysisDataService::Instance().remove(outputSpace + "_2");
   }
 
 private:
@@ -71,4 +74,37 @@ private:
   std::string outputSpace;
 };
 
+class LoadMcStasNexusTestPerformance : public CxxTest::TestSuite {
+public:
+  static LoadMcStasNexusTestPerformance *createSuite() {
+    return new LoadMcStasNexusTestPerformance();
+  }
+
+  static void destroySuite(LoadMcStasNexusTestPerformance *suite) {
+    delete suite;
+  }
+
+  void setUp() override {
+    if (!loadMcStasNexusAlg.isInitialized())
+      loadMcStasNexusAlg.initialize();
+
+    outputSpace = "LoadMcStasNexusTest";
+    loadMcStasNexusAlg.setPropertyValue("OutputWorkspace", outputSpace);
+
+    inputFile = "mcstas.n5";
+    loadMcStasNexusAlg.setPropertyValue("Filename", inputFile);
+  }
+
+  void tearDown() override {
+    AnalysisDataService::Instance().remove("LoadMcStasNexusTest_1");
+    AnalysisDataService::Instance().remove("LoadMcStasNexusTest_2");
+  }
+
+  void testExec() { loadMcStasNexusAlg.execute(); }
+
+private:
+  LoadMcStasNexus loadMcStasNexusAlg;
+  std::string inputFile;
+  std::string outputSpace;
+};
 #endif /*LOADMCSTASNEXUSTEST_H_*/
diff --git a/Framework/DataHandling/test/LoadMuonNexus1Test.h b/Framework/DataHandling/test/LoadMuonNexus1Test.h
index 9428b1ec308fc6af0fe3e6c20b93c9c869537a87..3eda343771cb5a1721d007198a6647eee08a51dc 100644
--- a/Framework/DataHandling/test/LoadMuonNexus1Test.h
+++ b/Framework/DataHandling/test/LoadMuonNexus1Test.h
@@ -4,14 +4,13 @@
 // These includes seem to make the difference between initialization of the
 // workspace names (workspace2D/1D etc), instrument classes and not for this
 // test case.
-#include "MantidDataObjects/WorkspaceSingleValue.h"
-#include "MantidDataObjects/TableWorkspace.h"
 #include "MantidDataHandling/LoadInstrument.h"
+#include "MantidDataObjects/TableWorkspace.h"
+#include "MantidDataObjects/WorkspaceSingleValue.h"
 
-#include <fstream>
 #include <cxxtest/TestSuite.h>
+#include <fstream>
 
-#include "MantidDataHandling/LoadMuonNexus1.h"
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/FrameworkManager.h"
@@ -21,9 +20,11 @@
 #include "MantidAPI/ScopedWorkspace.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidAPI/WorkspaceGroup.h"
+#include "MantidDataHandling/LoadMuonNexus1.h"
 #include "MantidKernel/ConfigService.h"
 #include "MantidKernel/TimeSeriesProperty.h"
 #include "MantidKernel/Unit.h"
+#include "MantidTestHelpers/HistogramDataTestHelper.h"
 
 #include <Poco/Path.h>
 
@@ -74,15 +75,15 @@ public:
     // "../../../../Test/Nexus/emu00006473.nxs";
     TS_ASSERT_EQUALS(output2D->getNumberHistograms(), 32);
     // Check two X vectors are the same
-    TS_ASSERT((output2D->dataX(3)) == (output2D->dataX(31)));
+    TS_ASSERT((output2D->x(3)) == (output2D->x(31)));
     // Check two Y arrays have the same number of elements
-    TS_ASSERT_EQUALS(output2D->dataY(5).size(), output2D->dataY(17).size());
+    TS_ASSERT_EQUALS(output2D->y(5).size(), output2D->y(17).size());
     // Check one particular value
-    TS_ASSERT_EQUALS(output2D->dataY(11)[686], 81);
+    TS_ASSERT_EQUALS(output2D->y(11)[686], 81);
     // Check that the error on that value is correct
-    TS_ASSERT_EQUALS(output2D->dataE(11)[686], 9);
+    TS_ASSERT_EQUALS(output2D->e(11)[686], 9);
     // Check that the time is as expected from bin boundary update
-    TS_ASSERT_DELTA(output2D->dataX(11)[687], 10.738, 0.001);
+    TS_ASSERT_DELTA(output2D->x(11)[687], 10.738, 0.001);
 
     // Check the unit has been set correctly
     TS_ASSERT_EQUALS(output->getAxis(0)->unit()->unitID(), "Label");
@@ -180,11 +181,11 @@ public:
       // "../../../../Test/Nexus/emu00006475.nxs";
       TS_ASSERT_EQUALS(output2D->getNumberHistograms(), 32);
       // Check two X vectors are the same
-      TS_ASSERT((output2D->dataX(3)) == (output2D->dataX(31)));
+      TS_ASSERT((output2D->x(3)) == (output2D->x(31)));
       // Check two Y arrays have the same number of elements
-      TS_ASSERT_EQUALS(output2D->dataY(5).size(), output2D->dataY(17).size());
+      TS_ASSERT_EQUALS(output2D->y(5).size(), output2D->y(17).size());
       // Check that the time is as expected from bin boundary update
-      TS_ASSERT_DELTA(output2D->dataX(11)[687], 10.738, 0.001);
+      TS_ASSERT_DELTA(output2D->x(11)[687], 10.738, 0.001);
 
       // Check the unit has been set correctly
       TS_ASSERT_EQUALS(output->getAxis(0)->unit()->unitID(), "Label");
@@ -218,15 +219,15 @@ public:
       // "../../../../Test/Nexus/emu00006475.nxs";
       TS_ASSERT_EQUALS(output2D->getNumberHistograms(), 32);
       // Check two X vectors are the same
-      TS_ASSERT((output2D->dataX(3)) == (output2D->dataX(31)));
+      TS_ASSERT((output2D->x(3)) == (output2D->x(31)));
       // Check two Y arrays have the same number of elements
-      TS_ASSERT_EQUALS(output2D->dataY(5).size(), output2D->dataY(17).size());
+      TS_ASSERT_EQUALS(output2D->y(5).size(), output2D->y(17).size());
       // Check one particular value
-      TS_ASSERT_EQUALS(output2D2->dataY(8)[502], 121);
+      TS_ASSERT_EQUALS(output2D2->y(8)[502], 121);
       // Check that the error on that value is correct
-      TS_ASSERT_EQUALS(output2D2->dataE(8)[502], 11);
+      TS_ASSERT_EQUALS(output2D2->e(8)[502], 11);
       // Check that the time is as expected from bin boundary update
-      TS_ASSERT_DELTA(output2D->dataX(11)[687], 10.738, 0.001);
+      TS_ASSERT_DELTA(output2D->x(11)[687], 10.738, 0.001);
 
       // Check the unit has been set correctly
       TS_ASSERT_EQUALS(output->getAxis(0)->unit()->unitID(), "Label");
@@ -283,15 +284,15 @@ public:
       // "../../../../Test/Nexus/emu00006475.nxs";
       TS_ASSERT_EQUALS(output2D->getNumberHistograms(), 32);
       // Check two X vectors are the same
-      TS_ASSERT((output2D->dataX(3)) == (output2D->dataX(31)));
+      TS_ASSERT((output2D->x(3)) == (output2D->x(31)));
       // Check two Y arrays have the same number of elements
-      TS_ASSERT_EQUALS(output2D->dataY(5).size(), output2D->dataY(17).size());
+      TS_ASSERT_EQUALS(output2D->y(5).size(), output2D->y(17).size());
       // Check one particular value
-      TS_ASSERT_EQUALS(output2D2->dataY(8)[502], 121);
+      TS_ASSERT_EQUALS(output2D2->y(8)[502], 121);
       // Check that the error on that value is correct
-      TS_ASSERT_EQUALS(output2D2->dataE(8)[502], 11);
+      TS_ASSERT_EQUALS(output2D2->e(8)[502], 11);
       // Check that the time is as expected from bin boundary update
-      TS_ASSERT_DELTA(output2D->dataX(11)[687], 10.738, 0.001);
+      TS_ASSERT_DELTA(output2D->x(11)[687], 10.738, 0.001);
 
       // Check the unit has been set correctly
       TS_ASSERT_EQUALS(output->getAxis(0)->unit()->unitID(), "Label");
@@ -327,17 +328,17 @@ public:
     TS_ASSERT_EQUALS(output2D->getNumberHistograms(), 9);
 
     // Check two X vectors are the same
-    TS_ASSERT((output2D->dataX(1)) == (output2D->dataX(5)));
+    TS_ASSERT((output2D->x(1)) == (output2D->x(5)));
 
     // Check two Y arrays have the same number of elements
-    TS_ASSERT_EQUALS(output2D->dataY(2).size(), output2D->dataY(7).size());
+    TS_ASSERT_EQUALS(output2D->y(2).size(), output2D->y(7).size());
 
     // Check one particular value
-    TS_ASSERT_EQUALS(output2D->dataY(8)[479], 144);
+    TS_ASSERT_EQUALS(output2D->y(8)[479], 144);
     // Check that the error on that value is correct
-    TS_ASSERT_EQUALS(output2D->dataE(8)[479], 12);
+    TS_ASSERT_EQUALS(output2D->e(8)[479], 12);
     // Check that the error on that value is correct
-    TS_ASSERT_DELTA(output2D->dataX(8)[479], 7.410, 0.0001);
+    TS_ASSERT_DELTA(output2D->x(8)[479], 7.410, 0.0001);
   }
 
   void testPartialSpectraLoading() {
@@ -381,20 +382,20 @@ public:
 
     // Check common spectra
     // X values should match
-    TS_ASSERT_EQUALS(out1->readX(0), out2->readX(0));
-    TS_ASSERT_EQUALS(out1->readX(4), out2->readX(5));
+    TS_ASSERT_EQUALS(out1->x(0), out2->x(0));
+    TS_ASSERT_EQUALS(out1->x(4), out2->x(5));
     // Check some Y values
-    TS_ASSERT_EQUALS(out1->readY(0), out2->readY(4));
-    TS_ASSERT_EQUALS(out1->readY(3), out2->readY(7));
-    TS_ASSERT_EQUALS(out1->readY(5), out2->readY(9));
-    TS_ASSERT_EQUALS(out1->readY(6), out2->readY(28));
-    TS_ASSERT_EQUALS(out1->readY(7), out2->readY(30));
+    TS_ASSERT_EQUALS(out1->y(0), out2->y(4));
+    TS_ASSERT_EQUALS(out1->y(3), out2->y(7));
+    TS_ASSERT_EQUALS(out1->y(5), out2->y(9));
+    TS_ASSERT_EQUALS(out1->y(6), out2->y(28));
+    TS_ASSERT_EQUALS(out1->y(7), out2->y(30));
     // Check some E values
-    TS_ASSERT_EQUALS(out1->readE(0), out2->readE(4));
-    TS_ASSERT_EQUALS(out1->readE(3), out2->readE(7));
-    TS_ASSERT_EQUALS(out1->readE(5), out2->readE(9));
-    TS_ASSERT_EQUALS(out1->readE(6), out2->readE(28));
-    TS_ASSERT_EQUALS(out1->readE(7), out2->readE(30));
+    TS_ASSERT_EQUALS(out1->e(0), out2->e(4));
+    TS_ASSERT_EQUALS(out1->e(3), out2->e(7));
+    TS_ASSERT_EQUALS(out1->e(5), out2->e(9));
+    TS_ASSERT_EQUALS(out1->e(6), out2->e(28));
+    TS_ASSERT_EQUALS(out1->e(7), out2->e(30));
 
     AnalysisDataService::Instance().remove("outWS1");
     AnalysisDataService::Instance().remove("outWS2");
@@ -755,13 +756,13 @@ public:
     TS_ASSERT_EQUALS(outWs->getNumberHistograms(), 2);
     TS_ASSERT_EQUALS(outWs->blocksize(), 2000);
 
-    TS_ASSERT_EQUALS(outWs->readY(0)[0], 461);
-    TS_ASSERT_EQUALS(outWs->readY(0)[1000], 192);
-    TS_ASSERT_EQUALS(outWs->readY(0)[1998], 1);
+    TS_ASSERT_EQUALS(outWs->y(0)[0], 461);
+    TS_ASSERT_EQUALS(outWs->y(0)[1000], 192);
+    TS_ASSERT_EQUALS(outWs->y(0)[1998], 1);
 
-    TS_ASSERT_EQUALS(outWs->readY(1)[0], 252);
-    TS_ASSERT_EQUALS(outWs->readY(1)[1000], 87);
-    TS_ASSERT_EQUALS(outWs->readY(1)[1998], 2);
+    TS_ASSERT_EQUALS(outWs->y(1)[0], 252);
+    TS_ASSERT_EQUALS(outWs->y(1)[1000], 87);
+    TS_ASSERT_EQUALS(outWs->y(1)[1998], 2);
   }
 
   void test_autoGroup_multiPeriod() {
@@ -797,13 +798,13 @@ public:
       TS_ASSERT_EQUALS(outWs1->getNumberHistograms(), 2);
       TS_ASSERT_EQUALS(outWs1->blocksize(), 2000);
 
-      TS_ASSERT_EQUALS(outWs1->readY(0)[0], 82);
-      TS_ASSERT_EQUALS(outWs1->readY(0)[458], 115);
-      TS_ASSERT_EQUALS(outWs1->readY(0)[1997], 1);
+      TS_ASSERT_EQUALS(outWs1->y(0)[0], 82);
+      TS_ASSERT_EQUALS(outWs1->y(0)[458], 115);
+      TS_ASSERT_EQUALS(outWs1->y(0)[1997], 1);
 
-      TS_ASSERT_EQUALS(outWs1->readY(1)[0], 6);
-      TS_ASSERT_EQUALS(outWs1->readY(1)[458], 91);
-      TS_ASSERT_EQUALS(outWs1->readY(1)[1997], 0);
+      TS_ASSERT_EQUALS(outWs1->y(1)[0], 6);
+      TS_ASSERT_EQUALS(outWs1->y(1)[458], 91);
+      TS_ASSERT_EQUALS(outWs1->y(1)[1997], 0);
     }
 
     auto outWs2 =
@@ -814,13 +815,13 @@ public:
       TS_ASSERT_EQUALS(outWs2->getNumberHistograms(), 2);
       TS_ASSERT_EQUALS(outWs2->blocksize(), 2000);
 
-      TS_ASSERT_EQUALS(outWs2->readY(0)[0], 16);
-      TS_ASSERT_EQUALS(outWs2->readY(0)[458], 132);
-      TS_ASSERT_EQUALS(outWs2->readY(0)[1930], 0);
+      TS_ASSERT_EQUALS(outWs2->y(0)[0], 16);
+      TS_ASSERT_EQUALS(outWs2->y(0)[458], 132);
+      TS_ASSERT_EQUALS(outWs2->y(0)[1930], 0);
 
-      TS_ASSERT_EQUALS(outWs2->readY(1)[0], 17);
-      TS_ASSERT_EQUALS(outWs2->readY(1)[458], 81);
-      TS_ASSERT_EQUALS(outWs2->readY(1)[1930], 1);
+      TS_ASSERT_EQUALS(outWs2->y(1)[0], 17);
+      TS_ASSERT_EQUALS(outWs2->y(1)[458], 81);
+      TS_ASSERT_EQUALS(outWs2->y(1)[1930], 1);
     }
   }
 
@@ -1027,14 +1028,19 @@ private:
 //------------------------------------------------------------------------------
 
 class LoadMuonNexus1TestPerformance : public CxxTest::TestSuite {
-public:
-  void testDefaultLoad() {
-    LoadMuonNexus1 loader;
+  void setUp() override {
     loader.initialize();
     loader.setPropertyValue("Filename", "emu00006475.nxs");
     loader.setPropertyValue("OutputWorkspace", "ws");
-    TS_ASSERT(loader.execute());
   }
+
+  void tearDown() override { AnalysisDataService::Instance().remove("ws"); }
+
+public:
+  void testDefaultLoad() { loader.execute(); }
+
+private:
+  LoadMuonNexus1 loader;
 };
 
 #endif /*LOADMUONNEXUS1TEST_H_*/
diff --git a/Framework/DataHandling/test/LoadMuonNexus2Test.h b/Framework/DataHandling/test/LoadMuonNexus2Test.h
index bb2a8c34f7315e441a4178e7ceb95daff64f1eb5..f2144b8d6bdffd9dc779ca6483c0f1d0a5432693 100644
--- a/Framework/DataHandling/test/LoadMuonNexus2Test.h
+++ b/Framework/DataHandling/test/LoadMuonNexus2Test.h
@@ -4,21 +4,22 @@
 // These includes seem to make the difference between initialization of the
 // workspace names (workspace2D/1D etc), instrument classes and not for this
 // test case.
-#include "MantidDataObjects/WorkspaceSingleValue.h"
 #include "MantidDataHandling/LoadInstrument.h"
+#include "MantidDataObjects/WorkspaceSingleValue.h"
 
-#include <fstream>
 #include <cxxtest/TestSuite.h>
+#include <fstream>
 
-#include "MantidDataHandling/LoadMuonNexus2.h"
-#include "MantidAPI/Axis.h"
-#include "MantidAPI/WorkspaceFactory.h"
 #include "MantidAPI/AnalysisDataService.h"
+#include "MantidAPI/Axis.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/Run.h"
+#include "MantidAPI/WorkspaceFactory.h"
+#include "MantidDataHandling/LoadMuonNexus2.h"
 #include "MantidKernel/ConfigService.h"
 #include "MantidKernel/TimeSeriesProperty.h"
 #include "MantidKernel/Unit.h"
+#include "MantidTestHelpers/HistogramDataTestHelper.h"
 
 using namespace Mantid::API;
 using namespace Mantid::Kernel;
@@ -84,20 +85,20 @@ public:
     TS_ASSERT_EQUALS(output2D->getNumberHistograms(), 192);
     TS_ASSERT_EQUALS(output2D->blocksize(), 2000);
     // Check two X vectors are the same
-    TS_ASSERT((output2D->dataX(3)) == (output2D->dataX(31)));
+    TS_ASSERT((output2D->x(3)) == (output2D->x(31)));
     // Check two Y arrays have the same number of elements
-    TS_ASSERT_EQUALS(output2D->dataY(5).size(), output2D->dataY(17).size());
+    TS_ASSERT_EQUALS(output2D->y(5).size(), output2D->y(17).size());
     // Check one particular value
-    TS_ASSERT_EQUALS(output2D->dataY(11)[686], 9);
-    TS_ASSERT_EQUALS(output2D->dataY(12)[686], 7);
-    TS_ASSERT_EQUALS(output2D->dataY(13)[686], 7);
+    TS_ASSERT_EQUALS(output2D->y(11)[686], 9);
+    TS_ASSERT_EQUALS(output2D->y(12)[686], 7);
+    TS_ASSERT_EQUALS(output2D->y(13)[686], 7);
 
     // Check that the error on that value is correct
-    TS_ASSERT_EQUALS(output2D->dataE(11)[686], 3);
-    TS_ASSERT_DELTA(output2D->dataE(12)[686], 2.646, 0.001);
-    TS_ASSERT_DELTA(output2D->dataE(13)[686], 2.646, 0.001);
+    TS_ASSERT_EQUALS(output2D->e(11)[686], 3);
+    TS_ASSERT_DELTA(output2D->e(12)[686], 2.646, 0.001);
+    TS_ASSERT_DELTA(output2D->e(13)[686], 2.646, 0.001);
     // Check that the time is as expected from bin boundary update
-    TS_ASSERT_DELTA(output2D->dataX(11)[687], 10.992, 0.001);
+    TS_ASSERT_DELTA(output2D->x(11)[687], 10.992, 0.001);
 
     // Check the unit has been set correctly
     TS_ASSERT_EQUALS(output->getAxis(0)->unit()->unitID(), "Label");
@@ -149,15 +150,9 @@ public:
     TS_ASSERT_EQUALS(output2D->getNumberHistograms(), 11);
     TS_ASSERT_EQUALS(output2D->blocksize(), 2000);
     // Check two X vectors are the same
-    TS_ASSERT((output2D->dataX(3)) == (output2D->dataX(7)));
+    TS_ASSERT((output2D->x(3)) == (output2D->x(7)));
     // Check two Y arrays have the same number of elements
-    TS_ASSERT_EQUALS(output2D->dataY(5).size(), output2D->dataY(10).size());
-    // Check one particular value
-    // TS_ASSERT_EQUALS( output2D->dataY(11)[686], 81);
-    // Check that the error on that value is correct
-    // TS_ASSERT_EQUALS( output2D->dataE(11)[686], 9);
-    // Check that the time is as expected from bin boundary update
-    // TS_ASSERT_DELTA( output2D->dataX(11)[687], 10.738,0.001);
+    TS_ASSERT_EQUALS(output2D->y(5).size(), output2D->y(10).size());
 
     // Check the unit has been set correctly
     TS_ASSERT_EQUALS(output->getAxis(0)->unit()->unitID(), "Label");
@@ -193,15 +188,9 @@ public:
     TS_ASSERT_EQUALS(output2D->getNumberHistograms(), 3);
     TS_ASSERT_EQUALS(output2D->blocksize(), 2000);
     // Check two X vectors are the same
-    TS_ASSERT((output2D->dataX(0)) == (output2D->dataX(2)));
+    TS_ASSERT((output2D->x(0)) == (output2D->x(2)));
     // Check two Y arrays have the same number of elements
-    TS_ASSERT_EQUALS(output2D->dataY(0).size(), output2D->dataY(1).size());
-    // Check one particular value
-    // TS_ASSERT_EQUALS( output2D->dataY(11)[686], 81);
-    // Check that the error on that value is correct
-    // TS_ASSERT_EQUALS( output2D->dataE(11)[686], 9);
-    // Check that the time is as expected from bin boundary update
-    // TS_ASSERT_DELTA( output2D->dataX(11)[687], 10.738,0.001);
+    TS_ASSERT_EQUALS(output2D->y(0).size(), output2D->y(1).size());
 
     // Check the unit has been set correctly
     TS_ASSERT_EQUALS(output->getAxis(0)->unit()->unitID(), "Label");
@@ -239,15 +228,9 @@ public:
     TS_ASSERT_EQUALS(output2D->getNumberHistograms(), 14);
     TS_ASSERT_EQUALS(output2D->blocksize(), 2000);
     // Check two X vectors are the same
-    TS_ASSERT((output2D->dataX(3)) == (output2D->dataX(7)));
+    TS_ASSERT((output2D->x(3)) == (output2D->x(7)));
     // Check two Y arrays have the same number of elements
-    TS_ASSERT_EQUALS(output2D->dataY(5).size(), output2D->dataY(10).size());
-    // Check one particular value
-    // TS_ASSERT_EQUALS( output2D->dataY(11)[686], 81);
-    // Check that the error on that value is correct
-    // TS_ASSERT_EQUALS( output2D->dataE(11)[686], 9);
-    // Check that the time is as expected from bin boundary update
-    // TS_ASSERT_DELTA( output2D->dataX(11)[687], 10.738,0.001);
+    TS_ASSERT_EQUALS(output2D->y(5).size(), output2D->y(10).size());
 
     // Check the unit has been set correctly
     TS_ASSERT_EQUALS(output->getAxis(0)->unit()->unitID(), "Label");
@@ -315,48 +298,25 @@ public:
     TS_ASSERT_EQUALS(output2D->getNumberHistograms(), 192);
     TS_ASSERT_EQUALS(output2D->blocksize(), 2000);
     // Check two X vectors are the same
-    TS_ASSERT((output2D->dataX(3)) == (output2D->dataX(31)));
+    TS_ASSERT((output2D->x(3)) == (output2D->x(31)));
     // Check two Y arrays have the same number of elements
-    TS_ASSERT_EQUALS(output2D->dataY(5).size(), output2D->dataY(17).size());
+    TS_ASSERT_EQUALS(output2D->y(5).size(), output2D->y(17).size());
     // Check one particular value
-    TS_ASSERT_EQUALS(output2D->dataY(11)[686], 7);
-    TS_ASSERT_EQUALS(output2D->dataY(12)[686], 2);
-    TS_ASSERT_EQUALS(output2D->dataY(13)[686], 6);
+    TS_ASSERT_EQUALS(output2D->y(11)[686], 7);
+    TS_ASSERT_EQUALS(output2D->y(12)[686], 2);
+    TS_ASSERT_EQUALS(output2D->y(13)[686], 6);
 
     // Check that the error on that value is correct
-    TS_ASSERT_DELTA(output2D->dataE(11)[686], 2.646, 0.001);
-    TS_ASSERT_DELTA(output2D->dataE(12)[686], 1.414, 0.001);
-    TS_ASSERT_DELTA(output2D->dataE(13)[686], 2.449, 0.001);
+    TS_ASSERT_DELTA(output2D->e(11)[686], 2.646, 0.001);
+    TS_ASSERT_DELTA(output2D->e(12)[686], 1.414, 0.001);
+    TS_ASSERT_DELTA(output2D->e(13)[686], 2.449, 0.001);
     // Check that the time is as expected from bin boundary update
-    TS_ASSERT_DELTA(output2D->dataX(11)[687], 10.992, 0.001);
+    TS_ASSERT_DELTA(output2D->x(11)[687], 10.992, 0.001);
 
     // Check the unit has been set correctly
     TS_ASSERT_EQUALS(output->getAxis(0)->unit()->unitID(), "Label");
     TS_ASSERT(!output->isDistribution());
 
-    /*
-    //----------------------------------------------------------------------
-    // Tests taken from LoadInstrumentTest to check Child Algorithm is running
-    properly
-    //----------------------------------------------------------------------
-    Instrument_sptr i = output->getInstrument();
-    Mantid::Geometry::IObjComponent_sptr source = i->getSource();
-
-    Mantid::Geometry::IObjComponent_sptr samplepos = i->getSample();
-    TS_ASSERT_EQUALS( samplepos->getName(), "nickel-holder");
-    TS_ASSERT_DELTA( samplepos->getPos().Y(), 10.0,0.01);
-
-
-    TS_ASSERT_EQUALS( source->getName(), "undulator");
-    TS_ASSERT_DELTA( source->getPos().Y(), 0.0,0.01);
-
-    Mantid::Geometry::Detector *ptrDet103 =
-    dynamic_cast<Mantid::Geometry::Detector*>(i->getDetector(103));
-    TS_ASSERT_EQUALS( ptrDet103->getID(), 103);
-    TS_ASSERT_EQUALS( ptrDet103->getName(), "pixel");
-    TS_ASSERT_DELTA( ptrDet103->getPos().X(), 0.4013,0.01);
-    TS_ASSERT_DELTA( ptrDet103->getPos().Z(), 2.4470,0.01);
-    */
     //----------------------------------------------------------------------
     // Test code copied from LoadLogTest to check Child Algorithm is running
     // properly
@@ -407,20 +367,20 @@ public:
     TS_ASSERT_EQUALS(output2D->getNumberHistograms(), 192);
     TS_ASSERT_EQUALS(output2D->blocksize(), 2000);
     // Check two X vectors are the same
-    TS_ASSERT((output2D->dataX(3)) == (output2D->dataX(31)));
+    TS_ASSERT((output2D->x(3)) == (output2D->x(31)));
     // Check two Y arrays have the same number of elements
-    TS_ASSERT_EQUALS(output2D->dataY(5).size(), output2D->dataY(17).size());
+    TS_ASSERT_EQUALS(output2D->y(5).size(), output2D->y(17).size());
     // Check one particular value
-    TS_ASSERT_EQUALS(output2D->dataY(11)[686], 4);
-    TS_ASSERT_EQUALS(output2D->dataY(12)[686], 6);
-    TS_ASSERT_EQUALS(output2D->dataY(13)[686], 0);
+    TS_ASSERT_EQUALS(output2D->y(11)[686], 4);
+    TS_ASSERT_EQUALS(output2D->y(12)[686], 6);
+    TS_ASSERT_EQUALS(output2D->y(13)[686], 0);
 
     // Check that the error on that value is correct
-    TS_ASSERT_DELTA(output2D->dataE(11)[686], 2, 0.001);
-    TS_ASSERT_DELTA(output2D->dataE(12)[686], 2.449, 0.001);
-    TS_ASSERT_DELTA(output2D->dataE(13)[686], 0, 0.001);
+    TS_ASSERT_DELTA(output2D->e(11)[686], 2, 0.001);
+    TS_ASSERT_DELTA(output2D->e(12)[686], 2.449, 0.001);
+    TS_ASSERT_DELTA(output2D->e(13)[686], 0, 0.001);
     // Check that the time is as expected from bin boundary update
-    TS_ASSERT_DELTA(output2D->dataX(11)[687], 10.992, 0.001);
+    TS_ASSERT_DELTA(output2D->x(11)[687], 10.992, 0.001);
 
     // Check the unit has been set correctly
     TS_ASSERT_EQUALS(output->getAxis(0)->unit()->unitID(), "Label");
@@ -484,20 +444,20 @@ public:
     TS_ASSERT_EQUALS(output2D->getNumberHistograms(), 2);
     TS_ASSERT_EQUALS(output2D->blocksize(), 8192);
     // Check two X vectors are the same
-    TS_ASSERT((output2D->dataX(0)) == (output2D->dataX(1)));
+    TS_ASSERT((output2D->x(0)) == (output2D->x(1)));
     // Check two Y arrays have the same number of elements
-    TS_ASSERT_EQUALS(output2D->dataY(0).size(), output2D->dataY(1).size());
+    TS_ASSERT_EQUALS(output2D->y(0).size(), output2D->y(1).size());
     // Check one particular value
-    TS_ASSERT_EQUALS(output2D->dataY(0)[686], 516);
-    TS_ASSERT_EQUALS(output2D->dataY(0)[687], 413);
-    TS_ASSERT_EQUALS(output2D->dataY(1)[686], 381);
+    TS_ASSERT_EQUALS(output2D->y(0)[686], 516);
+    TS_ASSERT_EQUALS(output2D->y(0)[687], 413);
+    TS_ASSERT_EQUALS(output2D->y(1)[686], 381);
 
     // Check that the error on that value is correct
-    TS_ASSERT_DELTA(output2D->dataE(0)[686], 22.7156, 0.001);
-    TS_ASSERT_DELTA(output2D->dataE(0)[687], 20.3224, 0.001);
-    TS_ASSERT_DELTA(output2D->dataE(1)[686], 19.5192, 0.001);
+    TS_ASSERT_DELTA(output2D->e(0)[686], 22.7156, 0.001);
+    TS_ASSERT_DELTA(output2D->e(0)[687], 20.3224, 0.001);
+    TS_ASSERT_DELTA(output2D->e(1)[686], 19.5192, 0.001);
     // Check that the time is as expected from bin boundary update
-    TS_ASSERT_DELTA(output2D->dataX(1)[687], 0.8050, 0.001);
+    TS_ASSERT_DELTA(output2D->x(1)[687], 0.8050, 0.001);
 
     // Check the unit has been set correctly
     TS_ASSERT_EQUALS(output->getAxis(0)->unit()->unitID(), "Label");
@@ -513,13 +473,18 @@ public:
 
 class LoadMuonNexus2TestPerformance : public CxxTest::TestSuite {
 public:
-  void testDefaultLoad() {
-    LoadMuonNexus2 loader;
+  void setUp() override {
     loader.initialize();
     loader.setPropertyValue("Filename", "emu00006475.nxs");
     loader.setPropertyValue("OutputWorkspace", "ws");
-    TS_ASSERT(loader.execute());
   }
+
+  void tearDown() override { AnalysisDataService::Instance().remove("ws"); }
+
+  void testDefaultLoad() { loader.execute(); }
+
+private:
+  LoadMuonNexus2 loader;
 };
 
 #endif /*LOADMUONNEXUS2TEST_H_*/
diff --git a/Framework/DataHandling/test/LoadNXcanSASTest.h b/Framework/DataHandling/test/LoadNXcanSASTest.h
index 7ff7c3ca011db961dc9877a6dbe1e4c132133fe2..c94ab870a97d32865d796162361c9dc6d81dac46 100644
--- a/Framework/DataHandling/test/LoadNXcanSASTest.h
+++ b/Framework/DataHandling/test/LoadNXcanSASTest.h
@@ -431,17 +431,17 @@ private:
 
     // Ensure that both have the same Y data
     auto readDataY =
-        [](MatrixWorkspace_sptr ws, size_t index) { return ws->dataY(index); };
+        [](MatrixWorkspace_sptr ws, size_t index) { return ws->y(index); };
     do_assert_data(transIn, transOut, readDataY);
 
     // Ensure that both have the same E data
     auto readDataE =
-        [](MatrixWorkspace_sptr ws, size_t index) { return ws->dataE(index); };
+        [](MatrixWorkspace_sptr ws, size_t index) { return ws->e(index); };
     do_assert_data(transIn, transOut, readDataE);
 
     // Ensure that both have the same X data
     auto readDataX =
-        [](MatrixWorkspace_sptr ws, size_t index) { return ws->dataX(index); };
+        [](MatrixWorkspace_sptr ws, size_t index) { return ws->x(index); };
     do_assert_data(transIn, transOut, readDataX);
   }
 
@@ -461,17 +461,17 @@ private:
 
     // Ensure that both have the same Y data
     auto readDataY =
-        [](MatrixWorkspace_sptr ws, size_t index) { return ws->dataY(index); };
+        [](MatrixWorkspace_sptr ws, size_t index) { return ws->y(index); };
     do_assert_data(wsIn, wsOut, readDataY);
 
     // Ensure that both have the same E data
     auto readDataE =
-        [](MatrixWorkspace_sptr ws, size_t index) { return ws->dataE(index); };
+        [](MatrixWorkspace_sptr ws, size_t index) { return ws->e(index); };
     do_assert_data(wsIn, wsOut, readDataE);
 
     // Ensure that both have the same X data
     auto readDataX =
-        [](MatrixWorkspace_sptr ws, size_t index) { return ws->dataX(index); };
+        [](MatrixWorkspace_sptr ws, size_t index) { return ws->x(index); };
     do_assert_data(wsIn, wsOut, readDataX);
 
     // If applicable, ensure that both have the same Xdev data
@@ -497,4 +497,97 @@ private:
   }
 };
 
+class LoadNXcanSASTestPerformance : public CxxTest::TestSuite {
+public:
+  static LoadNXcanSASTestPerformance *createSuite() {
+    return new LoadNXcanSASTestPerformance();
+  }
+
+  static void destroySuite(LoadNXcanSASTestPerformance *suite) { delete suite; }
+
+  LoadNXcanSASTestPerformance() {
+    setup_1D();
+    setup_2D();
+  }
+
+  ~LoadNXcanSASTestPerformance() {
+    AnalysisDataService::Instance().clear();
+    removeFile(parameters1D.filename);
+    removeFile(parameters2D.filename);
+  }
+
+  void test_execute_1D() { alg1D.execute(); }
+
+  void test_execute_2D() { alg2D.execute(); }
+
+private:
+  LoadNXcanSAS alg1D;
+  LoadNXcanSAS alg2D;
+  NXcanSASTestParameters parameters1D;
+  NXcanSASTestParameters parameters2D;
+
+  void save_no_assert(MatrixWorkspace_sptr ws,
+                      NXcanSASTestParameters &parameters) {
+    auto saveAlg = AlgorithmManager::Instance().createUnmanaged("SaveNXcanSAS");
+    saveAlg->initialize();
+    saveAlg->setProperty("Filename", parameters.filename);
+    saveAlg->setProperty("InputWorkspace", ws);
+    saveAlg->setProperty("RadiationSource", parameters.radiationSource);
+    if (!parameters.detectors.empty()) {
+      std::string detectorsAsString =
+          concatenateStringVector(parameters.detectors);
+      saveAlg->setProperty("DetectorNames", detectorsAsString);
+    }
+
+    saveAlg->execute();
+  }
+
+  void setup_1D() {
+    removeFile(parameters1D.filename);
+    parameters1D.detectors.push_back("front-detector");
+    parameters1D.detectors.push_back("rear-detector");
+    parameters1D.invalidDetectors = false;
+    parameters1D.hasDx = true;
+
+    auto ws = provide1DWorkspace(parameters1D);
+    setXValuesOn1DWorkspaceWithPointData(ws, parameters1D.xmin,
+                                         parameters1D.xmax);
+    parameters1D.idf = getIDFfromWorkspace(ws);
+
+    save_no_assert(ws, parameters1D);
+
+    const std::string outWsName = "loadNXcanSASTestOutputWorkspace";
+
+    alg1D.initialize();
+    alg1D.setPropertyValue("Filename", parameters1D.filename);
+
+    alg1D.setProperty("LoadTransmission", true);
+
+    alg1D.setPropertyValue("OutputWorkspace", outWsName);
+  }
+
+  void setup_2D() {
+    removeFile(parameters2D.filename);
+
+    parameters2D.detectors.push_back("front-detector");
+    parameters2D.detectors.push_back("rear-detector");
+    parameters2D.invalidDetectors = false;
+
+    parameters2D.is2dData = true;
+
+    auto ws = provide2DWorkspace(parameters2D);
+    set2DValues(ws);
+    const std::string outWsName = "loadNXcanSASTestOutputWorkspace";
+    parameters2D.idf = getIDFfromWorkspace(ws);
+
+    save_no_assert(ws, parameters2D);
+
+    alg2D.initialize();
+    alg2D.setPropertyValue("Filename", parameters2D.filename);
+
+    alg2D.setProperty("LoadTransmission", true);
+
+    alg2D.setPropertyValue("OutputWorkspace", outWsName);
+  }
+};
 #endif /* MANTID_DATAHANDLING_LOADNXCANSASTEST_H_ */
diff --git a/Framework/DataHandling/test/LoadNexusMonitorsTest.h b/Framework/DataHandling/test/LoadNexusMonitorsTest.h
index 00a8312c7f3729cd7e0d308cbc2f84e664e92f5e..7051fab7658ad221c483f1574a17bbd09a438fb7 100644
--- a/Framework/DataHandling/test/LoadNexusMonitorsTest.h
+++ b/Framework/DataHandling/test/LoadNexusMonitorsTest.h
@@ -1,23 +1,23 @@
 #ifndef LOADNEXUSMONITORSTEST_H_
 #define LOADNEXUSMONITORSTEST_H_
 
-#include <cxxtest/TestSuite.h>
-#include "MantidDataHandling/LoadNexusMonitors.h"
-#include "MantidDataHandling/LoadNexusMonitors2.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/Run.h"
 #include "MantidAPI/Sample.h"
 #include "MantidAPI/SpectrumInfo.h"
 #include "MantidAPI/WorkspaceGroup.h"
-#include "MantidGeometry/Instrument.h"
-#include "MantidGeometry/Instrument/Detector.h"
+#include "MantidDataHandling/LoadNexusMonitors.h"
+#include "MantidDataHandling/LoadNexusMonitors2.h"
 #include "MantidDataObjects/EventWorkspace.h"
 #include "MantidDataObjects/Workspace2D.h"
+#include "MantidGeometry/Instrument.h"
+#include "MantidGeometry/Instrument/Detector.h"
 #include "MantidKernel/ConfigService.h"
-#include <nexus/NeXusFile.hpp>
-#include <boost/shared_ptr.hpp>
 #include <Poco/File.h>
 #include <Poco/Path.h>
+#include <boost/shared_ptr.hpp>
+#include <cxxtest/TestSuite.h>
+#include <nexus/NeXusFile.hpp>
 
 using namespace Mantid::API;
 using namespace Mantid::DataObjects;
@@ -46,14 +46,14 @@ public:
     TS_ASSERT_EQUALS(WS->getNumberHistograms(), 3);
     // Check some histogram data
     // TOF
-    TS_ASSERT_EQUALS((*WS->refX(1)).size(), 200002);
-    TS_ASSERT_DELTA((*WS->refX(1))[3412], 3412.0, 1e-6);
+    TS_ASSERT_EQUALS(WS->x(1).size(), 200002);
+    TS_ASSERT_DELTA(WS->x(1)[3412], 3412.0, 1e-6);
     // Data
-    TS_ASSERT_EQUALS(WS->dataY(1).size(), 200001);
-    TS_ASSERT_DELTA(WS->dataY(1)[3412], 197., 1e-6);
+    TS_ASSERT_EQUALS(WS->y(1).size(), 200001);
+    TS_ASSERT_DELTA(WS->y(1)[3412], 197., 1e-6);
     // Error
-    TS_ASSERT_EQUALS(WS->dataE(1).size(), 200001);
-    TS_ASSERT_DELTA(WS->dataE(1)[3412], 14.03567, 1e-4);
+    TS_ASSERT_EQUALS(WS->e(1).size(), 200001);
+    TS_ASSERT_DELTA(WS->e(1)[3412], 14.03567, 1e-4);
     // Check geometry for a monitor
     const auto &specInfo = WS->spectrumInfo();
     TS_ASSERT(specInfo.isMonitor(2));
@@ -116,11 +116,11 @@ public:
     // Correct number of monitors found
     TS_ASSERT_EQUALS(WS->getNumberHistograms(), 2);
     // Monitors data is correct
-    TS_ASSERT_EQUALS(WS->readY(0)[0], 0);
-    TS_ASSERT_EQUALS(WS->readY(1)[0], 0);
+    TS_ASSERT_EQUALS(WS->y(0)[0], 0);
+    TS_ASSERT_EQUALS(WS->y(1)[0], 0);
 
-    TS_ASSERT_EQUALS(WS->readX(0)[0], 5.0);
-    TS_ASSERT_EQUALS(WS->readX(1)[5], 19995.0);
+    TS_ASSERT_EQUALS(WS->x(0)[0], 5.0);
+    TS_ASSERT_EQUALS(WS->x(1)[5], 19995.0);
   }
 
   void test_10_monitors() {
@@ -145,9 +145,9 @@ public:
     // Correct number of monitors found
     TS_ASSERT_EQUALS(WS->getNumberHistograms(), 3);
     // Monitors are in the right order
-    TS_ASSERT_EQUALS(WS->readY(0)[0], 1);
-    TS_ASSERT_EQUALS(WS->readY(1)[0], 2);
-    TS_ASSERT_EQUALS(WS->readY(2)[0], 10);
+    TS_ASSERT_EQUALS(WS->y(0)[0], 1);
+    TS_ASSERT_EQUALS(WS->y(1)[0], 2);
+    TS_ASSERT_EQUALS(WS->y(2)[0], 10);
 
     AnalysisDataService::Instance().clear();
     Poco::File(filename).remove();
@@ -240,4 +240,61 @@ public:
   }
 };
 
+class LoadNexusMonitorsTestPerformance : public CxxTest::TestSuite {
+public:
+  static LoadNexusMonitorsTestPerformance *createSuite() {
+    return new LoadNexusMonitorsTestPerformance();
+  }
+
+  static void destroySuite(LoadNexusMonitorsTestPerformance *suite) {
+    delete suite;
+  }
+
+  void setUp() override {
+    ld.initialize();
+    ld2.initialize();
+  }
+
+  void tearDown() override {
+    AnalysisDataService::Instance().remove("cncs");
+    AnalysisDataService::Instance().remove("hyspec");
+  }
+
+  void testExecV1() {
+    Mantid::API::FrameworkManager::Instance();
+    ld.setPropertyValue("Filename", "CNCS_7860_event.nxs");
+    ld.setPropertyValue("OutputWorkspace", "cncs");
+
+    ld.execute();
+  }
+
+  void testExecEventV1() {
+    Mantid::API::FrameworkManager::Instance();
+    ld.setPropertyValue("Filename", "HYSA_2411_monitors.nxs.h5");
+    ld.setPropertyValue("OutputWorkspace", "hyspec");
+
+    ld.execute();
+  }
+
+  void testExecV2() {
+    Mantid::API::FrameworkManager::Instance();
+    ld2.setPropertyValue("Filename", "CNCS_7860_event.nxs");
+    ld2.setPropertyValue("OutputWorkspace", "cncs");
+
+    ld2.execute();
+  }
+
+  void testExecEventV2() {
+    Mantid::API::FrameworkManager::Instance();
+    ld2.setPropertyValue("Filename", "HYSA_2411_monitors.nxs.h5");
+    ld2.setPropertyValue("OutputWorkspace", "hyspec");
+
+    ld2.execute();
+  }
+
+private:
+  LoadNexusMonitors ld;
+  LoadNexusMonitors2 ld2;
+};
+
 #endif /*LOADNEXUSMONITORSTEST_H_*/
diff --git a/Framework/DataHandling/test/LoadNexusProcessedTest.h b/Framework/DataHandling/test/LoadNexusProcessedTest.h
index 556d0b20bc6a6f1efd936d3920f5128c93e7e3ef..1422a06205747e12e86d559f2276e4049f7c72e3 100644
--- a/Framework/DataHandling/test/LoadNexusProcessedTest.h
+++ b/Framework/DataHandling/test/LoadNexusProcessedTest.h
@@ -964,7 +964,7 @@ public:
     for (size_t index = 0; index < 2; ++index) {
       // Create a sample workspace and add it to the ADS, so it gets a name.
       auto ws = WorkspaceCreationHelper::create1DWorkspaceConstant(
-          3, static_cast<double>(index), static_cast<double>(index));
+          3, static_cast<double>(index), static_cast<double>(index), true);
       AnalysisDataService::Instance().addOrReplace(workspaceName, ws);
       alg.setProperty("InputWorkspace",
                       boost::dynamic_pointer_cast<MatrixWorkspace>(ws));
diff --git a/Framework/DataHandling/test/LoadPDFgetNFileTest.h b/Framework/DataHandling/test/LoadPDFgetNFileTest.h
index d5bd74bbf2ca4e22916cf85c6a9f7e9271a6150e..1fa1ea202c3da0dd5e3885f061961803e007ab0a 100644
--- a/Framework/DataHandling/test/LoadPDFgetNFileTest.h
+++ b/Framework/DataHandling/test/LoadPDFgetNFileTest.h
@@ -48,7 +48,7 @@ public:
 
     TS_ASSERT_EQUALS(outws->getNumberHistograms(), 2);
 
-    TS_ASSERT_DELTA(outws->readX(0)[2], 0.17986950, 1.0E-8);
+    TS_ASSERT_DELTA(outws->x(0)[2], 0.17986950, 1.0E-8);
   }
 
   /** Test to load .sq file
diff --git a/Framework/DataHandling/test/LoadPreNexusMonitorsTest.h b/Framework/DataHandling/test/LoadPreNexusMonitorsTest.h
index 020501609fa26a38e0ea25c97960aabb5336e91b..ccc628500938eb24992d59426336f4d539d93e11 100644
--- a/Framework/DataHandling/test/LoadPreNexusMonitorsTest.h
+++ b/Framework/DataHandling/test/LoadPreNexusMonitorsTest.h
@@ -3,9 +3,10 @@
 
 #include <cxxtest/TestSuite.h>
 
-#include "MantidDataHandling/LoadPreNexusMonitors.h"
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidDataHandling/LoadPreNexusMonitors.h"
+#include "MantidTestHelpers/HistogramDataTestHelper.h"
 
 #include <Poco/Path.h>
 
@@ -52,11 +53,11 @@ public:
     TS_ASSERT_EQUALS(ws->blocksize(), 200001);
 
     // Check all the X axes are the same
-    TS_ASSERT((ws->dataX(0)) == (ws->dataX(1)));
+    TS_ASSERT((ws->x(0)) == (ws->x(1)));
 
     // Check a particular value
-    TS_ASSERT_EQUALS(ws->dataX(1)[3424], 3424.0);
-    TS_ASSERT_EQUALS(ws->dataY(1)[3424], 858);
+    TS_ASSERT_EQUALS(ws->x(1)[3424], 3424.0);
+    TS_ASSERT_EQUALS(ws->y(1)[3424], 858);
 
     for (int i = 0; i < 3; ++i) {
       TS_ASSERT_EQUALS(*ws->getSpectrum(i).getDetectorIDs().begin(),
diff --git a/Framework/DataHandling/test/LoadSaveAsciiTest.h b/Framework/DataHandling/test/LoadSaveAsciiTest.h
index 1571f24f690017dca9ff62127f2f91e0513bb54c..d281dbc0859653f8fa97d9b302d3d991fc6b4eb4 100644
--- a/Framework/DataHandling/test/LoadSaveAsciiTest.h
+++ b/Framework/DataHandling/test/LoadSaveAsciiTest.h
@@ -10,8 +10,8 @@
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/WorkspaceFactory.h"
-#include "MantidKernel/Unit.h"
 #include "MantidDataObjects/Workspace2D.h"
+#include "MantidKernel/Unit.h"
 #include <Poco/File.h>
 
 using namespace Mantid::API;
@@ -35,9 +35,9 @@ public:
         boost::dynamic_pointer_cast<Mantid::DataObjects::Workspace2D>(
             WorkspaceFactory::Instance().create("Workspace2D", 9, 10, 10));
     for (int i = 0; i < 9; i++) {
-      std::vector<double> &X = wsToSave->dataX(i);
-      std::vector<double> &Y = wsToSave->dataY(i);
-      std::vector<double> &E = wsToSave->dataE(i);
+      auto &X = wsToSave->mutableX(i);
+      auto &Y = wsToSave->mutableY(i);
+      auto &E = wsToSave->mutableE(i);
       for (int j = 0; j < 10; j++) {
         X[j] = 1. * j / 0.9;
         Y[j] = (i + 1) * (2. + 4. * X[j]);
@@ -70,17 +70,17 @@ public:
     TS_ASSERT_EQUALS(wsLoaded->getAxis(0)->unit()->caption(), "Energy");
     TS_ASSERT_EQUALS(wsLoaded->getAxis(0)->unit()->label(), "meV");
 
-    const std::vector<double> &X = wsLoaded->readX(0);
+    auto &X = wsLoaded->x(0);
     TS_ASSERT_EQUALS(X[0], 0);
     TS_ASSERT_EQUALS(X[1], 1.11111);
     TS_ASSERT_EQUALS(X[2], 2.22222);
     TS_ASSERT_EQUALS(X[5], 5.55556);
 
-    TS_ASSERT_EQUALS(wsLoaded->readY(0)[4], 19.7778);
-    TS_ASSERT_EQUALS(wsLoaded->readY(3)[7], 132.444);
-    TS_ASSERT_EQUALS(wsLoaded->readY(2)[5], 72.6667);
-    TS_ASSERT_EQUALS(wsLoaded->readY(5)[1], 38.6667);
-    TS_ASSERT_EQUALS(wsLoaded->readY(8)[8], 338);
+    TS_ASSERT_EQUALS(wsLoaded->y(0)[4], 19.7778);
+    TS_ASSERT_EQUALS(wsLoaded->y(3)[7], 132.444);
+    TS_ASSERT_EQUALS(wsLoaded->y(2)[5], 72.6667);
+    TS_ASSERT_EQUALS(wsLoaded->y(5)[1], 38.6667);
+    TS_ASSERT_EQUALS(wsLoaded->y(8)[8], 338);
 
     Poco::File(filename).remove();
   }
diff --git a/Framework/DataHandling/test/LoadTOFRawNexusTest.h b/Framework/DataHandling/test/LoadTOFRawNexusTest.h
index 894d61871c99dea611fcb75a343de72e312ec34f..039647da9bc749204abaf5e15cf42c315be29ed8 100644
--- a/Framework/DataHandling/test/LoadTOFRawNexusTest.h
+++ b/Framework/DataHandling/test/LoadTOFRawNexusTest.h
@@ -11,8 +11,8 @@
 #include "MantidGeometry/Instrument.h"
 #include "MantidKernel/Unit.h"
 
-#include <cxxtest/TestSuite.h>
 #include <Poco/File.h>
+#include <cxxtest/TestSuite.h>
 
 using namespace Mantid::API;
 using namespace Mantid::Kernel;
@@ -72,10 +72,9 @@ public:
     TS_ASSERT_EQUALS(spec.getSpectrumNo(), 27956);
     TS_ASSERT_EQUALS(spec.getDetectorIDs().size(), 1);
     TS_ASSERT(spec.hasDetectorID(27955));
-    MantidVec X, Y, E;
-    X = spec.dataX();
-    Y = spec.dataY();
-    E = spec.dataE();
+    auto &X = spec.x();
+    auto &Y = spec.y();
+    auto &E = spec.e();
     TS_ASSERT_EQUALS(X.size(), 502);
     TS_ASSERT_EQUALS(Y.size(), 501);
     TS_ASSERT_EQUALS(E.size(), 501);
@@ -92,8 +91,8 @@ public:
     TS_ASSERT_EQUALS(spec2.getSpectrumNo(), 38020);
     TS_ASSERT_EQUALS(spec2.getDetectorIDs().size(), 1);
     TS_ASSERT(spec2.hasDetectorID(38019));
-    TS_ASSERT_DELTA(spec2.dataY()[105], 23.0, 1e-4);
-    TS_ASSERT_DELTA(spec2.dataE()[105], sqrt(23.0), 1e-4);
+    TS_ASSERT_DELTA(spec2.y()[105], 23.0, 1e-4);
+    TS_ASSERT_DELTA(spec2.e()[105], sqrt(23.0), 1e-4);
 
     TS_ASSERT_EQUALS(ws->getAxis(1)->length(), 77824);
     TS_ASSERT_EQUALS(ws->getAxis(0)->length(), 502);
diff --git a/Framework/DataHandling/test/LoadVulcanCalFileTest.h b/Framework/DataHandling/test/LoadVulcanCalFileTest.h
index a1fd723afebe0aeaca0d9eb4fe788accf78ef750..80fe183855ec181868368c851fdf9b26acba9f74 100644
--- a/Framework/DataHandling/test/LoadVulcanCalFileTest.h
+++ b/Framework/DataHandling/test/LoadVulcanCalFileTest.h
@@ -1,12 +1,12 @@
 #ifndef MANTID_DATAHANDLING_LOCALVULCANCALFILETEST_H_
 #define MANTID_DATAHANDLING_LOCALVULCANCALFILETEST_H_
 
-#include <cxxtest/TestSuite.h>
-#include "MantidKernel/Timer.h"
-#include "MantidKernel/System.h"
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/Run.h"
 #include "MantidAPI/SpectrumInfo.h"
+#include "MantidKernel/System.h"
+#include "MantidKernel/Timer.h"
+#include <cxxtest/TestSuite.h>
 
 #include "MantidDataHandling/LoadVulcanCalFile.h"
 #include "MantidDataObjects/GroupingWorkspace.h"
@@ -58,8 +58,8 @@ public:
 
     TS_ASSERT_EQUALS(groupWS->getNumberHistograms(), 7392);
 
-    TS_ASSERT_EQUALS(int(groupWS->readY(0)[0]), 1);
-    TS_ASSERT_EQUALS(int(groupWS->readY(7391)[0]), 6);
+    TS_ASSERT_EQUALS(int(groupWS->y(0)[0]), 1);
+    TS_ASSERT_EQUALS(int(groupWS->y(7391)[0]), 6);
 
     // Check if filename is saved
     TS_ASSERT_EQUALS(alg.getPropertyValue("OffsetFilename"),
@@ -75,7 +75,7 @@ public:
       return;
 
     TS_ASSERT_DELTA(offsetsWS->getValue(26250), -0.000472175, 1e-7);
-    TS_ASSERT_DELTA(offsetsWS->readY(7391)[0], 6.39813e-05, 1e-7);
+    TS_ASSERT_DELTA(offsetsWS->y(7391)[0], 6.39813e-05, 1e-7);
     // Check if filename is saved
     TS_ASSERT_EQUALS(alg.getPropertyValue("OffsetFilename"),
                      offsetsWS->run().getProperty("Filename")->value());
@@ -149,7 +149,7 @@ public:
     const auto &spectrumInfo = maskWS->spectrumInfo();
     size_t nummasked = 0;
     for (size_t i = 0; i < maskWS->getNumberHistograms(); ++i) {
-      if (maskWS->readY(i)[0] > 0.5) {
+      if (maskWS->y(i)[0] > 0.5) {
         ++nummasked;
         TS_ASSERT(spectrumInfo.isMasked(i));
       }
diff --git a/Framework/DataHandling/test/MaskDetectorsTest.h b/Framework/DataHandling/test/MaskDetectorsTest.h
index 41030ac53d76caf7489a0e6726cc9befa84f92cb..2fbe98eb4f026dadebb07974993f9846cbbba47d 100644
--- a/Framework/DataHandling/test/MaskDetectorsTest.h
+++ b/Framework/DataHandling/test/MaskDetectorsTest.h
@@ -3,24 +3,21 @@
 
 #include <cxxtest/TestSuite.h>
 
-#include "MantidHistogramData/LinearGenerator.h"
-#include "MantidDataHandling/MaskDetectors.h"
+#include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/DetectorInfo.h"
 #include "MantidAPI/SpectrumInfo.h"
 #include "MantidAPI/WorkspaceProperty.h"
-#include "MantidKernel/ArrayProperty.h"
-#include "MantidDataObjects/Workspace2D.h"
+#include "MantidDataHandling/MaskDetectors.h"
 #include "MantidDataObjects/EventWorkspace.h"
+#include "MantidDataObjects/Workspace2D.h"
+#include "MantidGeometry/IDetector.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidGeometry/Instrument/Detector.h"
-#include "MantidAPI/FrameworkManager.h"
-#include "MantidAPI/WorkspaceFactory.h"
-#include "MantidAPI/AlgorithmManager.h"
-#include "MantidAPI/SpectrumInfo.h"
+#include "MantidHistogramData/LinearGenerator.h"
+#include "MantidKernel/ArrayProperty.h"
 #include "MantidTestHelpers/ComponentCreationHelper.h"
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
-#include "MantidGeometry/IDetector.h"
 
 using namespace Mantid::DataHandling;
 using namespace Mantid::Kernel;
@@ -106,7 +103,7 @@ public:
       specspace->initialize(numspec, 1, 1);
       for (size_t i = 0; i < specspace->getNumberHistograms(); i++) {
         // default to use all the detectors
-        specspace->dataY(i)[0] = 0.0;
+        specspace->mutableY(i)[0] = 0.0;
       }
       space = boost::dynamic_pointer_cast<MatrixWorkspace>(specspace);
       // Does not have connection between instrument and spectra though has to
@@ -181,16 +178,16 @@ public:
   void check_outputWS(MatrixWorkspace_const_sptr &outputWS) {
     double ones = 1.0;
     double zeroes = 0.0;
-    TS_ASSERT_EQUALS(outputWS->dataY(0)[0], zeroes);
-    TS_ASSERT_EQUALS(outputWS->dataE(0)[0], zeroes);
-    TS_ASSERT_EQUALS(outputWS->dataY(1)[0], ones);
-    TS_ASSERT_EQUALS(outputWS->dataE(1)[0], ones);
-    TS_ASSERT_EQUALS(outputWS->dataY(2)[0], zeroes);
-    TS_ASSERT_EQUALS(outputWS->dataE(2)[0], zeroes);
-    TS_ASSERT_EQUALS(outputWS->dataY(3)[0], zeroes);
-    TS_ASSERT_EQUALS(outputWS->dataE(3)[0], zeroes);
-    TS_ASSERT_EQUALS(outputWS->dataY(4)[0], ones);
-    TS_ASSERT_EQUALS(outputWS->dataE(4)[0], ones);
+    TS_ASSERT_EQUALS(outputWS->y(0)[0], zeroes);
+    TS_ASSERT_EQUALS(outputWS->e(0)[0], zeroes);
+    TS_ASSERT_EQUALS(outputWS->y(1)[0], ones);
+    TS_ASSERT_EQUALS(outputWS->e(1)[0], ones);
+    TS_ASSERT_EQUALS(outputWS->y(2)[0], zeroes);
+    TS_ASSERT_EQUALS(outputWS->e(2)[0], zeroes);
+    TS_ASSERT_EQUALS(outputWS->y(3)[0], zeroes);
+    TS_ASSERT_EQUALS(outputWS->e(3)[0], zeroes);
+    TS_ASSERT_EQUALS(outputWS->y(4)[0], ones);
+    TS_ASSERT_EQUALS(outputWS->e(4)[0], ones);
     const auto &spectrumInfo = outputWS->spectrumInfo();
     TS_ASSERT(spectrumInfo.isMasked(0));
     TS_ASSERT(!spectrumInfo.isMasked(1));
@@ -357,10 +354,10 @@ public:
       TS_ASSERT(spectrumInfo.hasDetectors(i));
       if (masked_indices.count(i) == 1) {
         TS_ASSERT_EQUALS(spectrumInfo.isMasked(i), true);
-        TS_ASSERT_EQUALS(originalWS->readY(i)[0], 0.0);
+        TS_ASSERT_EQUALS(originalWS->y(i)[0], 0.0);
       } else {
         TS_ASSERT_EQUALS(spectrumInfo.isMasked(i), false);
-        TS_ASSERT_EQUALS(originalWS->readY(i)[0], 1.0);
+        TS_ASSERT_EQUALS(originalWS->y(i)[0], 1.0);
       }
     }
 
@@ -392,7 +389,7 @@ public:
     for (int i = 0; i < static_cast<int>(existingMask->getNumberHistograms());
          i++)
       if (masked_indices.count(i) == 1)
-        existingMask->dataY(i)[0] = 1.0;
+        existingMask->mutableY(i)[0] = 1.0;
 
     // 3. Set properties and execute
     MaskDetectors masker;
@@ -421,10 +418,10 @@ public:
       TS_ASSERT(spectrumInfo.hasDetectors(i));
       if (masked_indices.count(i) == 1) {
         TS_ASSERT_EQUALS(spectrumInfo.isMasked(i), true);
-        TS_ASSERT_EQUALS(originalWS->readY(i)[0], 0.0);
+        TS_ASSERT_EQUALS(originalWS->y(i)[0], 0.0);
       } else {
         TS_ASSERT_EQUALS(spectrumInfo.isMasked(i), false);
-        TS_ASSERT_EQUALS(originalWS->readY(i)[0], 1.0);
+        TS_ASSERT_EQUALS(originalWS->y(i)[0], 1.0);
       }
     }
     AnalysisDataService::Instance().remove(inputWSName);
@@ -449,9 +446,9 @@ public:
 
     // Mask workspace index 0,3,4 in MaskWS. These will be maped to index 3,5 in
     // the test input
-    existingMask->dataY(0)[0] = 1.0;
-    existingMask->dataY(3)[0] = 1.0;
-    existingMask->dataY(4)[0] = 1.0;
+    existingMask->mutableY(0)[0] = 1.0;
+    existingMask->mutableY(3)[0] = 1.0;
+    existingMask->mutableY(4)[0] = 1.0;
 
     // Apply
     MaskDetectors masker;
@@ -515,7 +512,7 @@ public:
                   size_t n_dets) {
 
     for (size_t i = n_first_index; i < n_first_index + n_dets; i++) {
-      existingMask->dataY(i)[0] = 1.0;
+      existingMask->mutableY(i)[0] = 1.0;
     }
   }
   void test_MaskWorksForGroupedWSAllDet() {
@@ -606,9 +603,9 @@ public:
             existingMaskName);
     // Mask workspace index 1,20,55 in MaskWS. These will converted maped to
     //  indexes 1,2,5 in the target workspace.
-    existingMask->dataY(10)[0] = 1.0;
-    existingMask->dataY(20)[0] = 1.0;
-    existingMask->dataY(55)[0] = 1.0;
+    existingMask->mutableY(10)[0] = 1.0;
+    existingMask->mutableY(20)[0] = 1.0;
+    existingMask->mutableY(55)[0] = 1.0;
 
     MatrixWorkspace_sptr inputWS =
         AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
diff --git a/Framework/DataHandling/test/NXcanSASTestHelper.cpp b/Framework/DataHandling/test/NXcanSASTestHelper.cpp
index 7598619c6a8129561137fed8f60f368243701cfe..6cac005259ae3542e70be72733bf7cabae879424 100644
--- a/Framework/DataHandling/test/NXcanSASTestHelper.cpp
+++ b/Framework/DataHandling/test/NXcanSASTestHelper.cpp
@@ -80,10 +80,11 @@ provide1DWorkspace(NXcanSASTestParameters &parameters) {
   Mantid::API::MatrixWorkspace_sptr ws;
   if (parameters.hasDx) {
     ws = WorkspaceCreationHelper::create1DWorkspaceConstantWithXerror(
-        parameters.size, parameters.value, parameters.error, parameters.xerror);
+        parameters.size, parameters.value, parameters.error, parameters.xerror,
+        false);
   } else {
     ws = WorkspaceCreationHelper::create1DWorkspaceConstant(
-        parameters.size, parameters.value, parameters.error);
+        parameters.size, parameters.value, parameters.error, false);
   }
 
   ws->setTitle(parameters.workspaceTitle);
@@ -115,7 +116,7 @@ provide1DWorkspace(NXcanSASTestParameters &parameters) {
 Mantid::API::MatrixWorkspace_sptr
 getTransmissionWorkspace(NXcanSASTestTransmissionParameters &parameters) {
   auto ws = WorkspaceCreationHelper::create1DWorkspaceConstant(
-      parameters.size, parameters.value, parameters.error);
+      parameters.size, parameters.value, parameters.error, false);
   ws->setTitle(parameters.name);
   ws->getAxis(0)->unit() =
       Mantid::Kernel::UnitFactory::Instance().create("Wavelength");
diff --git a/Framework/DataHandling/test/SaveAscii2Test.h b/Framework/DataHandling/test/SaveAscii2Test.h
index 48914123011c2d3b30d167862bdc302ab51ae4fc..03e2a3f19a1dc3c87a1742a4a05e688d33c7714c 100644
--- a/Framework/DataHandling/test/SaveAscii2Test.h
+++ b/Framework/DataHandling/test/SaveAscii2Test.h
@@ -1,16 +1,16 @@
 #ifndef SAVEASCIITEST_H_
 #define SAVEASCIITEST_H_
 
-#include <cxxtest/TestSuite.h>
-#include "MantidDataHandling/SaveAscii2.h"
-#include "MantidDataObjects/Workspace2D.h"
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/TextAxis.h"
 #include "MantidAPI/WorkspaceFactory.h"
+#include "MantidDataHandling/SaveAscii2.h"
+#include "MantidDataObjects/Workspace2D.h"
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
-#include <fstream>
 #include <Poco/File.h>
+#include <cxxtest/TestSuite.h>
+#include <fstream>
 
 using namespace Mantid::API;
 using namespace Mantid::DataHandling;
@@ -118,9 +118,9 @@ public:
         boost::dynamic_pointer_cast<Mantid::DataObjects::Workspace2D>(
             WorkspaceFactory::Instance().create("Workspace2D", 2, 3, 3));
     for (int i = 0; i < 2; i++) {
-      std::vector<double> &X = wsToSave->dataX(i);
-      std::vector<double> &Y = wsToSave->dataY(i);
-      std::vector<double> &E = wsToSave->dataE(i);
+      auto &X = wsToSave->mutableX(i);
+      auto &Y = wsToSave->mutableY(i);
+      auto &E = wsToSave->mutableE(i);
       wsToSave->setPointStandardDeviations(i, 3);
       auto &DX = wsToSave->mutableDx(i);
       for (int j = 0; j < 3; j++) {
@@ -766,9 +766,9 @@ private:
     wsToSave = boost::dynamic_pointer_cast<Mantid::DataObjects::Workspace2D>(
         WorkspaceFactory::Instance().create("Workspace2D", 2, 3, 3));
     for (int i = 0; i < 2; i++) {
-      std::vector<double> &X = wsToSave->dataX(i);
-      std::vector<double> &Y = wsToSave->dataY(i);
-      std::vector<double> &E = wsToSave->dataE(i);
+      auto &X = wsToSave->mutableX(i);
+      auto &Y = wsToSave->mutableY(i);
+      auto &E = wsToSave->mutableE(i);
       for (int j = 0; j < 3; j++) {
         X[j] = 1.5 * j / 0.9;
         Y[j] = (i + 1) * (2. + 4. * X[j]);
diff --git a/Framework/DataHandling/test/SaveAsciiTest.h b/Framework/DataHandling/test/SaveAsciiTest.h
index ada5c579b7e42b493036347766456c56cd21df13..66b72e56eef5846dae351b7bd64e2c779a34874d 100644
--- a/Framework/DataHandling/test/SaveAsciiTest.h
+++ b/Framework/DataHandling/test/SaveAsciiTest.h
@@ -1,14 +1,15 @@
 #ifndef SAVEASCIITEST_H_
 #define SAVEASCIITEST_H_
 
-#include <cxxtest/TestSuite.h>
-#include "MantidDataHandling/SaveAscii.h"
-#include "MantidDataObjects/Workspace2D.h"
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/WorkspaceFactory.h"
-#include <fstream>
+#include "MantidDataHandling/SaveAscii.h"
+#include "MantidDataObjects/Workspace2D.h"
+#include "MantidHistogramData/LinearGenerator.h"
 #include <Poco/File.h>
+#include <cxxtest/TestSuite.h>
+#include <fstream>
 
 using namespace Mantid::API;
 using namespace Mantid::DataHandling;
@@ -35,9 +36,9 @@ public:
         boost::dynamic_pointer_cast<Mantid::DataObjects::Workspace2D>(
             WorkspaceFactory::Instance().create("Workspace2D", 2, 3, 3));
     for (int i = 0; i < 2; i++) {
-      std::vector<double> &X = wsToSave->dataX(i);
-      std::vector<double> &Y = wsToSave->dataY(i);
-      std::vector<double> &E = wsToSave->dataE(i);
+      auto &X = wsToSave->mutableX(i);
+      auto &Y = wsToSave->mutableY(i);
+      auto &E = wsToSave->mutableE(i);
       for (int j = 0; j < 3; j++) {
         X[j] = 1.5 * j / 0.9;
         Y[j] = (i + 1) * (2. + 4. * X[j]);
@@ -110,9 +111,9 @@ public:
         boost::dynamic_pointer_cast<Mantid::DataObjects::Workspace2D>(
             WorkspaceFactory::Instance().create("Workspace2D", 2, 3, 3));
     for (int i = 0; i < 2; i++) {
-      std::vector<double> &X = wsToSave->dataX(i);
-      std::vector<double> &Y = wsToSave->dataY(i);
-      std::vector<double> &E = wsToSave->dataE(i);
+      auto &X = wsToSave->mutableX(i);
+      auto &Y = wsToSave->mutableY(i);
+      auto &E = wsToSave->mutableE(i);
       wsToSave->setPointStandardDeviations(i, 3);
       auto &DX = wsToSave->mutableDx(i);
       for (int j = 0; j < 3; j++) {
diff --git a/Framework/DataHandling/test/SaveCSVTest.h b/Framework/DataHandling/test/SaveCSVTest.h
index b10beca6a1f93c39b80056e28ccf7e166357cc1d..f6de7b8bad0e313206197f751ec11d9ef8530327 100644
--- a/Framework/DataHandling/test/SaveCSVTest.h
+++ b/Framework/DataHandling/test/SaveCSVTest.h
@@ -3,18 +3,21 @@
 
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/WorkspaceFactory.h"
-#include "MantidAPI/WorkspaceFactory.h"
 #include "MantidDataHandling/SaveCSV.h"
 #include "MantidDataObjects/Workspace2D.h"
+#include "MantidHistogramData/LinearGenerator.h"
+#include <Poco/File.h>
 #include <cxxtest/TestSuite.h>
 #include <fstream>
-#include <Poco/File.h>
 
 using namespace Mantid::API;
 using namespace Mantid::Kernel;
 using namespace Mantid::DataHandling;
 using namespace Mantid::DataObjects;
 using Mantid::HistogramData::HistogramDx;
+using Mantid::HistogramData::BinEdges;
+using Mantid::HistogramData::Counts;
+using Mantid::HistogramData::LinearGenerator;
 
 // Notice, the SaveCSV algorithm currently does not create
 // an output workspace and therefore no tests related to the
@@ -41,9 +44,9 @@ public:
 
     double d = 0.0;
     for (int i = 0; i < 10; ++i, d += 0.1) {
-      localWorkspace2D_onePixel->dataX(0)[i] = d;
-      localWorkspace2D_onePixel->dataY(0)[i] = d + 1.0;
-      localWorkspace2D_onePixel->dataE(0)[i] = d + 2.0;
+      localWorkspace2D_onePixel->mutableX(0)[i] = d;
+      localWorkspace2D_onePixel->mutableY(0)[i] = d + 1.0;
+      localWorkspace2D_onePixel->mutableE(0)[i] = d + 2.0;
     }
 
     AnalysisDataService::Instance().add("SAVECSVTEST-testSpace",
@@ -129,12 +132,9 @@ private:
   MatrixWorkspace_sptr createWorkspaceWithDxValues(const size_t nSpec) const {
     auto ws = WorkspaceFactory::Instance().create("Workspace2D", nSpec,
                                                   nBins + 1, nBins);
+    BinEdges edges(nBins + 1, LinearGenerator(0, 1));
     for (size_t j = 0; j < nSpec; ++j) {
-      for (size_t k = 0; k < nBins + 1; ++k) {
-        ws->dataX(j)[k] = double(k);
-      }
-      ws->dataY(j).assign(nBins, double(j));
-      ws->dataE(j).assign(nBins, sqrt(double(j)));
+      ws->setHistogram(j, edges, Counts(nBins, double(j)));
       ws->setPointStandardDeviations(j, nBins, sqrt(double(j)));
     }
     return ws;
diff --git a/Framework/DataHandling/test/SaveCanSAS1dTest.h b/Framework/DataHandling/test/SaveCanSAS1dTest.h
index 5a8fe2c988e978398e14f42807a744d60e2ace9b..4dce5dba89232b1beabcc65d35ee78092b90533e 100644
--- a/Framework/DataHandling/test/SaveCanSAS1dTest.h
+++ b/Framework/DataHandling/test/SaveCanSAS1dTest.h
@@ -5,21 +5,21 @@
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/Sample.h"
 #include "MantidAPI/WorkspaceGroup.h"
+#include "MantidDataHandling/LoadCanSAS1D.h"
 #include "MantidDataHandling/LoadRaw3.h"
 #include "MantidDataHandling/SaveCanSAS1D.h"
-#include "MantidDataHandling/LoadCanSAS1D.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidKernel/UnitFactory.h"
 
-#include <Poco/File.h>
-#include <Poco/Path.h>
+#include <Poco/AutoPtr.h>
+#include <Poco/DOM/DOMParser.h>
 #include <Poco/DOM/Document.h>
+#include <Poco/DOM/Node.h>
 #include <Poco/DOM/NodeFilter.h>
 #include <Poco/DOM/NodeIterator.h>
-#include <Poco/DOM/Node.h>
-#include <Poco/AutoPtr.h>
+#include <Poco/File.h>
+#include <Poco/Path.h>
 #include <Poco/SAX/InputSource.h>
-#include <Poco/DOM/DOMParser.h>
 
 #include <fstream>
 #include <sstream>
@@ -227,21 +227,21 @@ public:
     TS_ASSERT_EQUALS(ws2d->getInstrument()->getName(), "IRIS");
 
     TS_ASSERT_EQUALS(ws2d->getNumberHistograms(), 1);
-    TS_ASSERT_EQUALS(ws2d->dataX(0).size(), 2000);
+    TS_ASSERT_EQUALS(ws2d->x(0).size(), 2000);
 
     // some of the data is only stored to 3 decimal places
     double tolerance(1e-04);
-    TS_ASSERT_DELTA(ws2d->dataX(0).front(), 56005, tolerance);
-    TS_ASSERT_DELTA(ws2d->dataX(0)[1000], 66005, tolerance);
-    TS_ASSERT_DELTA(ws2d->dataX(0).back(), 75995, tolerance);
+    TS_ASSERT_DELTA(ws2d->x(0).front(), 56005, tolerance);
+    TS_ASSERT_DELTA(ws2d->x(0)[1000], 66005, tolerance);
+    TS_ASSERT_DELTA(ws2d->x(0).back(), 75995, tolerance);
 
-    TS_ASSERT_DELTA(ws2d->dataY(0).front(), 0, tolerance);
-    TS_ASSERT_DELTA(ws2d->dataY(0)[1000], 1.0, tolerance);
-    TS_ASSERT_DELTA(ws2d->dataY(0).back(), 0, tolerance);
+    TS_ASSERT_DELTA(ws2d->y(0).front(), 0, tolerance);
+    TS_ASSERT_DELTA(ws2d->y(0)[1000], 1.0, tolerance);
+    TS_ASSERT_DELTA(ws2d->y(0).back(), 0, tolerance);
 
-    TS_ASSERT_DELTA(ws2d->dataE(0).front(), 0, tolerance);
-    TS_ASSERT_DELTA(ws2d->dataE(0)[1000], 1.0, tolerance);
-    TS_ASSERT_DELTA(ws2d->dataE(0).back(), 0, tolerance);
+    TS_ASSERT_DELTA(ws2d->e(0).front(), 0, tolerance);
+    TS_ASSERT_DELTA(ws2d->e(0)[1000], 1.0, tolerance);
+    TS_ASSERT_DELTA(ws2d->e(0).back(), 0, tolerance);
 
     // Check that sample information is correct
     auto &sample = ws2d->sample();
diff --git a/Framework/DataHandling/test/SaveCanSAS1dTest2.h b/Framework/DataHandling/test/SaveCanSAS1dTest2.h
index 2ea7b1cd9db174dcd349152796d89eba3d1b5de2..ce6e995d2e96cd5063a0f4ba3d2b31b731221f36 100644
--- a/Framework/DataHandling/test/SaveCanSAS1dTest2.h
+++ b/Framework/DataHandling/test/SaveCanSAS1dTest2.h
@@ -3,17 +3,17 @@
 #include <cxxtest/TestSuite.h>
 
 #include "MantidAPI/Axis.h"
-#include "MantidAPI/WorkspaceGroup.h"
 #include "MantidAPI/Sample.h"
+#include "MantidAPI/WorkspaceGroup.h"
+#include "MantidDataHandling/LoadCanSAS1D2.h"
 #include "MantidDataHandling/LoadRaw3.h"
 #include "MantidDataHandling/SaveCanSAS1D2.h"
-#include "MantidDataHandling/LoadCanSAS1D2.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidKernel/UnitFactory.h"
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
 
-#include <Poco/Path.h>
 #include <Poco/File.h>
+#include <Poco/Path.h>
 
 #include <fstream>
 #include <sstream>
@@ -265,21 +265,21 @@ public:
     TS_ASSERT_EQUALS(ws2d->getInstrument()->getName(), "IRIS");
 
     TS_ASSERT_EQUALS(ws2d->getNumberHistograms(), 1);
-    TS_ASSERT_EQUALS(ws2d->dataX(0).size(), 2000);
+    TS_ASSERT_EQUALS(ws2d->x(0).size(), 2000);
 
     // some of the data is only stored to 3 decimal places
     double tolerance(1e-04);
-    TS_ASSERT_DELTA(ws2d->dataX(0).front(), 56005, tolerance);
-    TS_ASSERT_DELTA(ws2d->dataX(0)[1000], 66005, tolerance);
-    TS_ASSERT_DELTA(ws2d->dataX(0).back(), 75995, tolerance);
+    TS_ASSERT_DELTA(ws2d->x(0).front(), 56005, tolerance);
+    TS_ASSERT_DELTA(ws2d->x(0)[1000], 66005, tolerance);
+    TS_ASSERT_DELTA(ws2d->x(0).back(), 75995, tolerance);
 
-    TS_ASSERT_DELTA(ws2d->dataY(0).front(), 0, tolerance);
-    TS_ASSERT_DELTA(ws2d->dataY(0)[1000], 1.0, tolerance);
-    TS_ASSERT_DELTA(ws2d->dataY(0).back(), 0, tolerance);
+    TS_ASSERT_DELTA(ws2d->y(0).front(), 0, tolerance);
+    TS_ASSERT_DELTA(ws2d->y(0)[1000], 1.0, tolerance);
+    TS_ASSERT_DELTA(ws2d->y(0).back(), 0, tolerance);
 
-    TS_ASSERT_DELTA(ws2d->dataE(0).front(), 0, tolerance);
-    TS_ASSERT_DELTA(ws2d->dataE(0)[1000], 1.0, tolerance);
-    TS_ASSERT_DELTA(ws2d->dataE(0).back(), 0, tolerance);
+    TS_ASSERT_DELTA(ws2d->e(0).front(), 0, tolerance);
+    TS_ASSERT_DELTA(ws2d->e(0)[1000], 1.0, tolerance);
+    TS_ASSERT_DELTA(ws2d->e(0).back(), 0, tolerance);
   }
 
   void test_that_can_save_and_load_full_collimation_information() {
@@ -299,7 +299,7 @@ private:
                                     double expectedWidth,
                                     double expectedHeight) {
     // Create sample workspace
-    auto wsIn = WorkspaceCreationHelper::create1DWorkspaceRand(3);
+    auto wsIn = WorkspaceCreationHelper::create1DWorkspaceRand(3, true);
     auto axis = wsIn->getAxis(0);
     axis->unit() = UnitFactory::Instance().create("MomentumTransfer");
     axis->title() = "|Q|";
diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument.h b/Framework/Geometry/inc/MantidGeometry/Instrument.h
index ee2a6ef89af12d3ef650a0784bb1720ad546fd7b..8604cc704d5032844cc02c3325c76ef52f4c9aa8 100644
--- a/Framework/Geometry/inc/MantidGeometry/Instrument.h
+++ b/Framework/Geometry/inc/MantidGeometry/Instrument.h
@@ -212,20 +212,6 @@ public:
   boost::shared_ptr<const Instrument> getPhysicalInstrument() const;
   void setPhysicalInstrument(boost::shared_ptr<const Instrument>);
 
-  // ----- Useful static functions ------
-  static double calcConversion(const double l1, const Kernel::V3D &beamline,
-                               const double beamline_norm,
-                               const Kernel::V3D &samplePos,
-                               const Kernel::V3D &detectorPos,
-                               const double offset);
-
-  static double
-  calcConversion(const double l1, const Kernel::V3D &beamline,
-                 const double beamline_norm, const Kernel::V3D &samplePos,
-                 const boost::shared_ptr<const Instrument> &instrument,
-                 const std::vector<detid_t> &detectors,
-                 const std::map<detid_t, double> &offsets);
-
   void getInstrumentParameters(double &l1, Kernel::V3D &beamline,
                                double &beamline_norm,
                                Kernel::V3D &samplePos) const;
@@ -336,6 +322,17 @@ private:
   /// associated with an ExperimentInfo object.
   boost::shared_ptr<const Beamline::DetectorInfo> m_detectorInfo{nullptr};
 };
+namespace Conversion {
+
+MANTID_GEOMETRY_DLL double tofToDSpacingFactor(const double l1, const double l2,
+                                               const double twoTheta,
+                                               const double offset);
+
+double MANTID_GEOMETRY_DLL
+tofToDSpacingFactor(const double l1, const double l2, const double twoTheta,
+                    const std::vector<detid_t> &detectors,
+                    const std::map<detid_t, double> &offsets);
+}
 
 } // namespace Geometry
 } // Namespace Mantid
diff --git a/Framework/Geometry/src/Instrument.cpp b/Framework/Geometry/src/Instrument.cpp
index ac1e9032bb376109b777c44f2d5db38f650fc2c2..23a82264143154560c45b8b80696c217544ba4d4 100644
--- a/Framework/Geometry/src/Instrument.cpp
+++ b/Framework/Geometry/src/Instrument.cpp
@@ -883,73 +883,6 @@ void Instrument::appendPlottable(
 const double CONSTANT = (PhysicalConstants::h * 1e10) /
                         (2.0 * PhysicalConstants::NeutronMass * 1e6);
 
-//-----------------------------------------------------------------------
-/** Calculate the conversion factor (tof -> d-spacing) for a single pixel, i.e.,
- *1/DIFC for that pixel.
- *
- * @param l1 :: Primary flight path.
- * @param beamline: vector = samplePos-sourcePos = a vector pointing from the
- *source to the sample,
- *        the length of the distance between the two.
- * @param beamline_norm: (source to sample distance) * 2.0 (apparently)
- * @param samplePos: position of the sample
- * @param detPos: position of the detector
- * @param offset: value (close to zero) that changes the factor := factor *
- *(1+offset).
- */
-double Instrument::calcConversion(const double l1, const Kernel::V3D &beamline,
-                                  const double beamline_norm,
-                                  const Kernel::V3D &samplePos,
-                                  const Kernel::V3D &detPos,
-                                  const double offset) {
-  if (offset <=
-      -1.) // not physically possible, means result is negative d-spacing
-  {
-    std::stringstream msg;
-    msg << "Encountered offset of " << offset
-        << " which converts data to negative d-spacing\n";
-    throw std::logic_error(msg.str());
-  }
-
-  // Now detPos will be set with respect to samplePos
-  Kernel::V3D relDetPos = detPos - samplePos;
-  // 0.5*cos(2theta)
-  double l2 = relDetPos.norm();
-  double halfcosTwoTheta =
-      relDetPos.scalar_prod(beamline) / (l2 * beamline_norm);
-  // This is sin(theta)
-  double sinTheta = sqrt(0.5 - halfcosTwoTheta);
-  const double numerator = (1.0 + offset);
-  sinTheta *= (l1 + l2);
-  return (numerator * CONSTANT) / sinTheta;
-}
-
-//-----------------------------------------------------------------------
-/** Calculate the conversion factor (tof -> d-spacing)
- * for a LIST of detectors assigned to a single spectrum.
- */
-double Instrument::calcConversion(
-    const double l1, const Kernel::V3D &beamline, const double beamline_norm,
-    const Kernel::V3D &samplePos,
-    const boost::shared_ptr<const Instrument> &instrument,
-    const std::vector<detid_t> &detectors,
-    const std::map<detid_t, double> &offsets) {
-  double factor = 0.;
-  double offset;
-  for (auto detector : detectors) {
-    auto off_iter = offsets.find(detector);
-    if (off_iter != offsets.cend()) {
-      offset = offsets.find(detector)->second;
-    } else {
-      offset = 0.;
-    }
-    factor +=
-        calcConversion(l1, beamline, beamline_norm, samplePos,
-                       instrument->getDetector(detector)->getPos(), offset);
-  }
-  return factor / static_cast<double>(detectors.size());
-}
-
 //------------------------------------------------------------------------------------------------
 /** Get several instrument parameters used in tof to D-space conversion
  *
@@ -1306,6 +1239,62 @@ void Instrument::setDetectorInfo(
     m_map_nonconst->setDetectorInfo(detectorInfo);
   m_detectorInfo = std::move(detectorInfo);
 }
+namespace Conversion {
+
+/**
+ * Calculate and return conversion factor from tof to d-spacing.
+ * @param l1
+ * @param l2
+ * @param twoTheta scattering angle
+ * @param offset
+ * @return
+ */
+double tofToDSpacingFactor(const double l1, const double l2,
+                           const double twoTheta, const double offset) {
+  if (offset <=
+      -1.) // not physically possible, means result is negative d-spacing
+  {
+    std::stringstream msg;
+    msg << "Encountered offset of " << offset
+        << " which converts data to negative d-spacing\n";
+    throw std::logic_error(msg.str());
+  }
+
+  auto sinTheta = std::sin(twoTheta / 2);
+
+  const double numerator = (1.0 + offset);
+  sinTheta *= (l1 + l2);
+
+  return (numerator * CONSTANT) / sinTheta;
+}
 
+/** Calculate the conversion factor from tof -> d-spacing
+ * for a LIST of detector ids assigned to a single spectrum.
+ * @brief tofToDSpacingFactor
+ * @param l1
+ * @param l2
+ * @param twoTheta scattering angle
+ * @param detectors
+ * @param offsets
+ * @return
+ */
+double tofToDSpacingFactor(const double l1, const double l2,
+                           const double twoTheta,
+                           const std::vector<detid_t> &detectors,
+                           const std::map<detid_t, double> &offsets) {
+  double factor = 0.;
+  double offset;
+  for (auto detector : detectors) {
+    auto off_iter = offsets.find(detector);
+    if (off_iter != offsets.cend()) {
+      offset = offsets.find(detector)->second;
+    } else {
+      offset = 0.;
+    }
+    factor += tofToDSpacingFactor(l1, l2, twoTheta, offset);
+  }
+  return factor / static_cast<double>(detectors.size());
+}
+}
 } // namespace Geometry
 } // Namespace Mantid
diff --git a/Framework/MDAlgorithms/src/LessThanMD.cpp b/Framework/MDAlgorithms/src/LessThanMD.cpp
index 9baaae9db06f10637f5147902ffd32be42f92693..b219c09704cf1ed3cfbb9dc042e60df8ead42207 100644
--- a/Framework/MDAlgorithms/src/LessThanMD.cpp
+++ b/Framework/MDAlgorithms/src/LessThanMD.cpp
@@ -30,7 +30,7 @@ void LessThanMD::execHistoHisto(
 void LessThanMD::execHistoScalar(
     Mantid::DataObjects::MDHistoWorkspace_sptr out,
     Mantid::DataObjects::WorkspaceSingleValue_const_sptr scalar) {
-  out->lessThan(scalar->dataY(0)[0]);
+  out->lessThan(scalar->y(0)[0]);
 }
 
 } // namespace Mantid
diff --git a/Framework/MDAlgorithms/src/LoadILLAscii.cpp b/Framework/MDAlgorithms/src/LoadILLAscii.cpp
index ca0b778248dd30a9d0b2d78591224506acca027d..b0a04f769fc7711b6ffe1bf6d4bdda27274e20b4 100644
--- a/Framework/MDAlgorithms/src/LoadILLAscii.cpp
+++ b/Framework/MDAlgorithms/src/LoadILLAscii.cpp
@@ -21,8 +21,8 @@
 #include "MantidKernel/UnitFactory.h"
 #include "MantidMDAlgorithms/LoadILLAsciiHelper.h"
 
-#include <boost/shared_ptr.hpp>
 #include <Poco/TemporaryFile.h>
+#include <boost/shared_ptr.hpp>
 
 #include <fstream>
 #include <iterator> // std::distance
@@ -276,16 +276,16 @@ IMDEventWorkspace_sptr LoadILLAscii::mergeWorkspaces(
 
   if (!workspaceList.empty()) {
     Progress progress(this, 0, 1, workspaceList.size());
-    for (auto it = workspaceList.begin(); it < workspaceList.end(); ++it) {
-      std::size_t pos = std::distance(workspaceList.begin(), it);
-      API::MatrixWorkspace_sptr thisWorkspace = *it;
 
-      std::size_t nHist = thisWorkspace->getNumberHistograms();
-      const auto &specInfo = thisWorkspace->spectrumInfo();
+    for (size_t pos = 0; pos < workspaceList.size(); ++pos) {
+      const auto &workspace = workspaceList[pos];
+
+      std::size_t nHist = workspace->getNumberHistograms();
+      const auto &specInfo = workspace->spectrumInfo();
       for (std::size_t i = 0; i < nHist; ++i) {
-        Geometry::IDetector_const_sptr det = thisWorkspace->getDetector(i);
-        const auto &signal = thisWorkspace->y(i);
-        const auto &error = thisWorkspace->e(i);
+        Geometry::IDetector_const_sptr det = workspace->getDetector(i);
+        const auto &signal = workspace->y(i);
+        const auto &error = workspace->e(i);
         myfile << signal[0] << " ";
         myfile << error[0] << " ";
         myfile << specInfo.detector(i).getID() << " ";
@@ -318,7 +318,6 @@ IMDEventWorkspace_sptr LoadILLAscii::mergeWorkspaces(
                                "ImportMDEventWorkspace"));
 
     return workspace;
-
   } else {
     throw std::runtime_error("Error: No workspaces were found to be merged!");
   }
diff --git a/Framework/MDAlgorithms/src/MDNormDirectSC.cpp b/Framework/MDAlgorithms/src/MDNormDirectSC.cpp
index b2452e8332f6b37d822e3fe3afd122a69d9731b7..1d819e0014da9aff95873abf6528b3828cc0ee8a 100644
--- a/Framework/MDAlgorithms/src/MDNormDirectSC.cpp
+++ b/Framework/MDAlgorithms/src/MDNormDirectSC.cpp
@@ -10,11 +10,11 @@
 #include "MantidDataObjects/MDHistoWorkspace.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidKernel/CompositeValidator.h"
+#include "MantidKernel/ConfigService.h"
+#include "MantidKernel/PhysicalConstants.h"
 #include "MantidKernel/Strings.h"
 #include "MantidKernel/TimeSeriesProperty.h"
 #include "MantidKernel/VectorHelper.h"
-#include "MantidKernel/ConfigService.h"
-#include "MantidKernel/PhysicalConstants.h"
 
 namespace Mantid {
 namespace MDAlgorithms {
@@ -479,7 +479,7 @@ void MDNormDirectSC::calculateNormalization(
     // Get solid angle for this contribution
     double solid = protonCharge;
     if (haveSA) {
-      solid = solidAngleWS->readY(solidAngDetToIdx.find(detID)->second)[0] *
+      solid = solidAngleWS->y(solidAngDetToIdx.find(detID)->second)[0] *
               protonCharge;
     }
     // Compute final position in HKL
diff --git a/Framework/MDAlgorithms/src/MDNormSCD.cpp b/Framework/MDAlgorithms/src/MDNormSCD.cpp
index 4a26e440bbdec155a92c3dd9846d86ce25912f48..866d15d23ab3ebe6334938397390247274069f09 100644
--- a/Framework/MDAlgorithms/src/MDNormSCD.cpp
+++ b/Framework/MDAlgorithms/src/MDNormSCD.cpp
@@ -426,8 +426,7 @@ void MDNormSCD::calculateNormalization(
     size_t wsIdx = fluxDetToIdx.find(detID)->second;
     // Get solid angle for this contribution
     double solid =
-        solidAngleWS->readY(solidAngDetToIdx.find(detID)->second)[0] *
-        protonCharge;
+        solidAngleWS->y(solidAngDetToIdx.find(detID)->second)[0] * protonCharge;
 
     // -- calculate integrals for the intersection --
     // momentum values at intersections
@@ -503,14 +502,14 @@ void MDNormSCD::calcIntegralsForIntersections(
   assert(xValues.size() == yValues.size());
 
   // the x-data from the workspace
-  const auto &xData = integrFlux.readX(sp);
+  const auto &xData = integrFlux.x(sp);
   const double xStart = xData.front();
   const double xEnd = xData.back();
 
   // the values in integrFlux are expected to be integrals of a non-negative
   // function
   // ie they must make a non-decreasing function
-  const auto &yData = integrFlux.readY(sp);
+  const auto &yData = integrFlux.y(sp);
   size_t spSize = yData.size();
 
   const double yMin = 0.0;
diff --git a/Framework/MDAlgorithms/src/MinusMD.cpp b/Framework/MDAlgorithms/src/MinusMD.cpp
index c0c2cb8e91ac001e301bb50730f765f7f7d4a0fb..b4e9f9a2a622e8ba6dec0404134d013129bf14d6 100644
--- a/Framework/MDAlgorithms/src/MinusMD.cpp
+++ b/Framework/MDAlgorithms/src/MinusMD.cpp
@@ -1,9 +1,9 @@
 #include "MantidMDAlgorithms/MinusMD.h"
-#include "MantidKernel/System.h"
+#include "MantidDataObjects/MDBox.h"
+#include "MantidDataObjects/MDBoxIterator.h"
 #include "MantidDataObjects/MDEventFactory.h"
 #include "MantidDataObjects/MDEventWorkspace.h"
-#include "MantidDataObjects/MDBoxIterator.h"
-#include "MantidDataObjects/MDBox.h"
+#include "MantidKernel/System.h"
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -132,7 +132,7 @@ void MinusMD::execHistoHisto(
 void MinusMD::execHistoScalar(
     Mantid::DataObjects::MDHistoWorkspace_sptr out,
     Mantid::DataObjects::WorkspaceSingleValue_const_sptr scalar) {
-  out->subtract(scalar->dataY(0)[0], scalar->dataE(0)[0]);
+  out->subtract(scalar->y(0)[0], scalar->e(0)[0]);
 }
 
 } // namespace Mantid
diff --git a/Framework/MDAlgorithms/src/MultiplyMD.cpp b/Framework/MDAlgorithms/src/MultiplyMD.cpp
index 4354a80469a8ecb2f259cdff26f57d120f4dd14d..f6de68c186cefc3ab978eda5ae9644012df0c48b 100644
--- a/Framework/MDAlgorithms/src/MultiplyMD.cpp
+++ b/Framework/MDAlgorithms/src/MultiplyMD.cpp
@@ -1,9 +1,9 @@
-#include "MantidKernel/System.h"
 #include "MantidMDAlgorithms/MultiplyMD.h"
-#include "MantidDataObjects/MDBoxBase.h"
 #include "MantidDataObjects/MDBox.h"
+#include "MantidDataObjects/MDBoxBase.h"
 #include "MantidDataObjects/MDEventFactory.h"
 #include "MantidDataObjects/MDEventWorkspace.h"
+#include "MantidKernel/System.h"
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -47,8 +47,8 @@ void MultiplyMD::checkInputs() {
 template <typename MDE, size_t nd>
 void MultiplyMD::execEventScalar(typename MDEventWorkspace<MDE, nd>::sptr ws) {
   // Get the scalar multiplying
-  float scalar = float(m_rhs_scalar->dataY(0)[0]);
-  float scalarError = float(m_rhs_scalar->dataE(0)[0]);
+  float scalar = static_cast<float>(m_rhs_scalar->y(0)[0]);
+  float scalarError = static_cast<float>(m_rhs_scalar->e(0)[0]);
   float scalarErrorSquared = scalarError * scalarError;
   float scalarSquared = scalar * scalar;
 
@@ -119,7 +119,7 @@ void MultiplyMD::execHistoHisto(
 void MultiplyMD::execHistoScalar(
     Mantid::DataObjects::MDHistoWorkspace_sptr out,
     Mantid::DataObjects::WorkspaceSingleValue_const_sptr scalar) {
-  out->multiply(scalar->dataY(0)[0], scalar->dataE(0)[0]);
+  out->multiply(scalar->y(0)[0], scalar->e(0)[0]);
 }
 
 } // namespace Mantid
diff --git a/Framework/MDAlgorithms/src/PlusMD.cpp b/Framework/MDAlgorithms/src/PlusMD.cpp
index 1fbe4b1d6b00551f2cdaa3e45e25a33fc06f007e..beb6fb754900b5a19b99fed5298c5d9423438141 100644
--- a/Framework/MDAlgorithms/src/PlusMD.cpp
+++ b/Framework/MDAlgorithms/src/PlusMD.cpp
@@ -1,11 +1,11 @@
+#include "MantidMDAlgorithms/PlusMD.h"
 #include "MantidAPI/IMDEventWorkspace.h"
-#include "MantidKernel/System.h"
 #include "MantidDataObjects/MDBoxBase.h"
 #include "MantidDataObjects/MDBoxIterator.h"
 #include "MantidDataObjects/MDEventFactory.h"
-#include "MantidMDAlgorithms/PlusMD.h"
-#include "MantidKernel/ThreadScheduler.h"
+#include "MantidKernel/System.h"
 #include "MantidKernel/ThreadPool.h"
+#include "MantidKernel/ThreadScheduler.h"
 
 using namespace Mantid::Kernel;
 using namespace Mantid::DataObjects;
@@ -147,7 +147,7 @@ void PlusMD::execHistoHisto(
 void PlusMD::execHistoScalar(
     Mantid::DataObjects::MDHistoWorkspace_sptr out,
     Mantid::DataObjects::WorkspaceSingleValue_const_sptr scalar) {
-  out->add(scalar->dataY(0)[0], scalar->dataE(0)[0]);
+  out->add(scalar->y(0)[0], scalar->e(0)[0]);
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/MDAlgorithms/test/AccumulateMDTest.h b/Framework/MDAlgorithms/test/AccumulateMDTest.h
index eb145a00780c6f1818966aceb4d8221bca1ddf06..d075faa76f61d52b521fc4c92e6f6de1baa76c94 100644
--- a/Framework/MDAlgorithms/test/AccumulateMDTest.h
+++ b/Framework/MDAlgorithms/test/AccumulateMDTest.h
@@ -98,7 +98,7 @@ public:
 
     // Create a cheap workspace
     std::string ws_name = "ACCUMULATEMDTEST_EXISTENTWORKSPACE";
-    auto bkg_ws = WorkspaceCreationHelper::create1DWorkspaceRand(1);
+    auto bkg_ws = WorkspaceCreationHelper::create1DWorkspaceRand(1, true);
     // add to ADS (no choice but to use ADS here)
     AnalysisDataService::Instance().add(ws_name, bkg_ws);
 
diff --git a/Framework/MDAlgorithms/test/ConvertMDHistoToMatrixWorkspaceTest.h b/Framework/MDAlgorithms/test/ConvertMDHistoToMatrixWorkspaceTest.h
index 5015e2cd5b18188243a967915f341d35c5a07e69..4a5cbae59c9cd0e2d071ac18e85a8e2a33106c93 100644
--- a/Framework/MDAlgorithms/test/ConvertMDHistoToMatrixWorkspaceTest.h
+++ b/Framework/MDAlgorithms/test/ConvertMDHistoToMatrixWorkspaceTest.h
@@ -138,7 +138,7 @@ public:
 public:
   void test_input_workspace_must_be_imdhisto() {
     MatrixWorkspace_sptr ws =
-        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 0);
+        WorkspaceCreationHelper::create1DWorkspaceConstant(1, 1, 0, true);
     ConvertMDHistoToMatrixWorkspace alg;
     alg.setRethrows(true);
     alg.initialize();
diff --git a/Framework/MDAlgorithms/test/MDNormSCDTest.h b/Framework/MDAlgorithms/test/MDNormSCDTest.h
index f2528100a1e2e9aee22924e03a5692c3ccdb7d3c..f797981d062a56f0ddf48610b8a838ebd44266e4 100644
--- a/Framework/MDAlgorithms/test/MDNormSCDTest.h
+++ b/Framework/MDAlgorithms/test/MDNormSCDTest.h
@@ -3,11 +3,11 @@
 
 #include <cxxtest/TestSuite.h>
 
-#include "MantidMDAlgorithms/MDNormSCD.h"
-#include "MantidMDAlgorithms/CreateMDWorkspace.h"
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/IMDHistoWorkspace.h"
 #include "MantidAPI/WorkspaceFactory.h"
+#include "MantidMDAlgorithms/CreateMDWorkspace.h"
+#include "MantidMDAlgorithms/MDNormSCD.h"
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
 
 using Mantid::MDAlgorithms::MDNormSCD;
@@ -77,13 +77,13 @@ private:
   void createGoodFluxWorkspace(const std::string &wsName) {
     auto flux =
         WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(2, 10);
-    auto &x = flux->readX(0);
-    auto &y1 = flux->dataY(1);
+    const auto &x = flux->x(0);
+    auto &y1 = flux->mutableY(1);
 
     for (size_t i = 0; i < y1.size(); ++i) {
       y1[i] = 2 * x[i];
     }
-    flux->setX(1, flux->refX(0));
+    flux->setSharedX(1, flux->sharedX(0));
     flux->getAxis(0)->setUnit("Momentum");
 
     AnalysisDataService::Instance().addOrReplace(wsName, flux);
@@ -92,13 +92,13 @@ private:
   void createBadFluxWorkspace(const std::string &wsName) {
     auto flux =
         WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(2, 10);
-    auto &x = flux->readX(0);
-    auto &y1 = flux->dataY(1);
+    const auto &x = flux->x(0);
+    auto &y1 = flux->mutableY(1);
 
     for (size_t i = 0; i < y1.size(); ++i) {
       y1[i] = -2 * x[i];
     }
-    flux->setX(1, flux->refX(0));
+    flux->setSharedX(1, flux->sharedX(0));
     flux->getAxis(0)->setUnit("Momentum");
 
     AnalysisDataService::Instance().addOrReplace(wsName, flux);
diff --git a/Framework/PythonInterface/mantid/kernel/funcinspect.py b/Framework/PythonInterface/mantid/kernel/funcinspect.py
index 599981fd17c0b3fd75edda97bd5dda82262a5253..1da6e1e69032960d9efbe82e1d7f32b0642e09b0 100644
--- a/Framework/PythonInterface/mantid/kernel/funcinspect.py
+++ b/Framework/PythonInterface/mantid/kernel/funcinspect.py
@@ -1,4 +1,4 @@
-"""
+"""
     Defines functions that can be used to inspect the properties of a
     function call. For example
 
diff --git a/Framework/PythonInterface/mantid/simpleapi.py b/Framework/PythonInterface/mantid/simpleapi.py
index d75206a052282019afbab8dd7107fed36d5f3ffb..2164f3061d2a80a8bc0344e72a17a5e72dd2142f 100644
--- a/Framework/PythonInterface/mantid/simpleapi.py
+++ b/Framework/PythonInterface/mantid/simpleapi.py
@@ -1,4 +1,4 @@
-"""
+"""
     This module defines a simple function-style API for running Mantid
     algorithms. Each algorithm within Mantid is mapped to a Python
     function of the same name with the parameters of the algorithm becoming
@@ -24,6 +24,7 @@ from __future__ import (absolute_import, division,
 
 import os
 from six import iteritems
+from collections import OrderedDict, namedtuple
 
 from . import api as _api
 from . import kernel as _kernel
@@ -566,8 +567,12 @@ def _get_function_spec(func):
     :param func: A Python function object
     """
     import inspect
+    import six
     try:
-        argspec = inspect.getargspec(func)
+        if six.PY3:
+            argspec = inspect.getfullargspec(func)
+        else:
+            argspec = inspect.getargspec(func)
     except TypeError:
         return ''
     # Algorithm functions have varargs set not args
@@ -789,7 +794,7 @@ def _gather_returns(func_name, lhs, algm_obj, ignore_regex=None):
     for index, expr in enumerate(ignore_regex):
         ignore_regex[index] = re.compile(expr)
 
-    retvals = []
+    retvals = OrderedDict()
     for name in algm_obj.outputProperties():
         if ignore_property(name, ignore_regex):
             continue
@@ -801,14 +806,14 @@ def _gather_returns(func_name, lhs, algm_obj, ignore_regex=None):
         if _is_workspace_property(prop):
             value_str = prop.valueAsStr
             try:
-                retvals.append(_api.AnalysisDataService[value_str])
+                retvals[name]=_api.AnalysisDataService[value_str]
             except KeyError:
                 if not prop.isOptional():
                     raise RuntimeError("Internal error. Output workspace property '%s' on algorithm '%s' has not been stored correctly."
                                        "Please contact development team." % (name,  algm_obj.name()))
         else:
             if hasattr(prop, 'value'):
-                retvals.append(prop.value)
+                retvals[name]=prop.value
             else:
                 raise RuntimeError('Internal error. Unknown property type encountered. "%s" on algorithm "%s" is not understood by '
                        'Python. Please contact development team' % (name, algm_obj.name()))
@@ -821,10 +826,13 @@ def _gather_returns(func_name, lhs, algm_obj, ignore_regex=None):
         # Let's not have the more cryptic unpacking error raised
         raise RuntimeError("%s is trying to return %d output(s) but you have provided %d variable(s). "
                            "These numbers must match." % (func_name, nvals, nlhs))
-    if nvals > 1:
-        return tuple(retvals) # Create a tuple
-    elif nvals == 1:
-        return retvals[0]
+    if nvals > 0:
+        ret_type=namedtuple(func_name+"_returns",retvals.keys())
+        ret_value=ret_type(**retvals)
+        if nvals==1:
+            return ret_value[0]
+        else:
+            return ret_value
     else:
         return None
 
diff --git a/Framework/PythonInterface/plugins/algorithms/AngularAutoCorrelationsTwoAxes.py b/Framework/PythonInterface/plugins/algorithms/AngularAutoCorrelationsTwoAxes.py
index 4ce5753eb67eaa551bbf4ab4195b25c872b06d99..de407e3b29efa2f6063c672d559601acb61ffe1c 100644
--- a/Framework/PythonInterface/plugins/algorithms/AngularAutoCorrelationsTwoAxes.py
+++ b/Framework/PythonInterface/plugins/algorithms/AngularAutoCorrelationsTwoAxes.py
@@ -310,7 +310,7 @@ class AngularAutoCorrelationsTwoAxes(PythonAlgorithm):
 
     def fold_correlation(self,omega):
         # Folds an array with symmetrical values into half by averaging values around the centre
-        right_half=omega[int(len(omega))/2:]
+        right_half=omega[int(len(omega))//2:]
         left_half=omega[:int(np.ceil(len(omega)/2.0))][::-1]
 
         return (left_half+right_half)/2.0
diff --git a/Framework/PythonInterface/plugins/algorithms/MaskAngle.py b/Framework/PythonInterface/plugins/algorithms/MaskAngle.py
index 0128b109359c5bac44d46b9f6e356b752f70aedf..6419703717a88b809fdec783f6127fe9aff7d315 100644
--- a/Framework/PythonInterface/plugins/algorithms/MaskAngle.py
+++ b/Framework/PythonInterface/plugins/algorithms/MaskAngle.py
@@ -1,4 +1,4 @@
-#pylint: disable=no-init,invalid-name
+#pylint: disable=no-init,invalid-name
 from __future__ import (absolute_import, division, print_function)
 import mantid.simpleapi
 import mantid.kernel
diff --git a/Framework/PythonInterface/plugins/algorithms/MatchPeaks.py b/Framework/PythonInterface/plugins/algorithms/MatchPeaks.py
index e2f8887125afbcb6076283f60ea3f3c41dbf848a..c164fc407fff681b79dbbba851c3868f0b4ea735 100644
--- a/Framework/PythonInterface/plugins/algorithms/MatchPeaks.py
+++ b/Framework/PythonInterface/plugins/algorithms/MatchPeaks.py
@@ -19,18 +19,18 @@ def mask_ws(ws_to_mask, xstart, xend):
 
     if xstart > 0:
         logger.debug('Mask bins smaller than {0}'.format(xstart))
-        MaskBins(InputWorkspace=ws_to_mask, OutputWorkspace=ws_to_mask, XMin=x_values[0], XMax=x_values[xstart])
+        MaskBins(InputWorkspace=ws_to_mask, OutputWorkspace=ws_to_mask, XMin=x_values[0], XMax=x_values[int(xstart)])
     else:
         logger.debug('No masking due to x bin <= 0!: {0}'.format(xstart))
     if xend < len(x_values) - 1:
         logger.debug('Mask bins larger than {0}'.format(xend))
-        MaskBins(InputWorkspace=ws_to_mask, OutputWorkspace=ws_to_mask, XMin=x_values[xend + 1], XMax=x_values[-1])
+        MaskBins(InputWorkspace=ws_to_mask, OutputWorkspace=ws_to_mask, XMin=x_values[int(xend) + 1], XMax=x_values[-1])
     else:
         logger.debug('No masking due to x bin >= len(x_values) - 1!: {0}'.format(xend))
 
     if xstart > 0 and xend < len(x_values) - 1:
         logger.information('Bins out of range {0} {1} [Unit of X-axis] are masked'.format
-                           (x_values[xstart],x_values[xend + 1]))
+                           (x_values[int(xstart)],x_values[int(xend) + 1]))
 
 
 class MatchPeaks(PythonAlgorithm):
diff --git a/Framework/PythonInterface/plugins/algorithms/VelocityAutoCorrelations.py b/Framework/PythonInterface/plugins/algorithms/VelocityAutoCorrelations.py
index 79e573173362fc01fb32bce38d84413489396dcb..a21eaac8bc5c63733f25a5eee263bace31b8f4ae 100644
--- a/Framework/PythonInterface/plugins/algorithms/VelocityAutoCorrelations.py
+++ b/Framework/PythonInterface/plugins/algorithms/VelocityAutoCorrelations.py
@@ -308,7 +308,7 @@ class VelocityAutoCorrelations(PythonAlgorithm):
 
     def fold_correlation(self,w):
         # Folds an array with symmetrical values into half by averaging values around the centre
-        right_half=w[len(w)/2:]
+        right_half=w[len(w)//2:]
         left_half=w[:int(np.ceil(len(w)/2.0))][::-1]
 
         return (left_half+right_half)/2.0
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py
index 323afec25c180b7bd4d5b610349208221d5f95d9..703fa93850e41f2bad097a5d72ff3d29edfe3328 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py
@@ -24,6 +24,7 @@ class ApplyPaalmanPingsCorrection(PythonAlgorithm):
     _can_shift_factor = 0.0
     _scaled_container_wavelength = None
     _sample_ws_wavelength = None
+    _rebin_container_ws = False
 
     def category(self):
         return "Workflow\\MIDAS"
@@ -52,6 +53,10 @@ class ApplyPaalmanPingsCorrection(PythonAlgorithm):
         self.declareProperty(MatrixWorkspaceProperty('OutputWorkspace', '', direction=Direction.Output),
                              doc='The output corrections workspace.')
 
+        self.declareProperty(name='RebinCanToSample',
+                             defaultValue=True,
+                             doc=('Enable or disable RebinToWorkspace on CanWorkspace.'))
+
     #pylint: disable=too-many-branches
     def PyExec(self):
         self._setup()
@@ -251,6 +256,8 @@ class ApplyPaalmanPingsCorrection(PythonAlgorithm):
         self._can_shift_factor = self.getProperty('CanShiftFactor').value
         self._shift_can = self._can_shift_factor != 0.0
 
+        self._rebin_container_ws = self.getProperty('RebinCanToSample').value
+
         # This temporary WS is needed because ConvertUnits does not like named WS in a Group
         self._corrections = '__converted_corrections'
         self._scaled_container = '__scaled_container'
@@ -330,17 +337,14 @@ class ApplyPaalmanPingsCorrection(PythonAlgorithm):
         Do a simple container subtraction (when no corrections are given).
         """
 
-        logger.information('Rebining container to ensure Minus')
-        s_api.RebinToWorkspace(WorkspaceToRebin=self._can_ws_name,
-                               WorkspaceToMatch=self._sample_ws_wavelength,
-                               OutputWorkspace=self._can_ws_name)
-
         logger.information('Using simple container subtraction')
 
-        # Rebin can
-        s_api.RebinToWorkspace(WorkspaceToRebin=self._scaled_container_wavelength,
-                               WorkspaceToMatch=self._sample_ws_wavelength,
-                               OutputWorkspace=self._scaled_container_wavelength)
+        if self._rebin_container_ws:
+            logger.information('Rebining container to ensure Minus')
+            s_api.RebinToWorkspace(
+                WorkspaceToRebin=self._scaled_container_wavelength,
+                WorkspaceToMatch=self._sample_ws_wavelength,
+                OutputWorkspace=self._scaled_container_wavelength)
 
         s_api.Minus(LHSWorkspace=self._sample_ws_wavelength,
                     RHSWorkspace=self._scaled_container_wavelength,
@@ -376,9 +380,10 @@ class ApplyPaalmanPingsCorrection(PythonAlgorithm):
                                            self._corrections + f_type,
                                            "Wavelength")
 
-        s_api.RebinToWorkspace(WorkspaceToRebin=self._scaled_container_wavelength,
-                               WorkspaceToMatch=self._corrections + '_acc',
-                               OutputWorkspace=self._scaled_container_wavelength)
+        if self._rebin_container_ws:
+            s_api.RebinToWorkspace(WorkspaceToRebin=self._scaled_container_wavelength,
+                                   WorkspaceToMatch=self._corrections + '_acc',
+                                   OutputWorkspace=self._scaled_container_wavelength)
 
         # Acc
         s_api.Divide(LHSWorkspace=self._scaled_container_wavelength,
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectILLReductionQENS.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectILLReductionQENS.py
index dd6bc424226ccdcd397f24ca1e2bd07fffcbc6ad..633d7a348e15d485113e996f472c7d7ac4685689 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectILLReductionQENS.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectILLReductionQENS.py
@@ -172,11 +172,11 @@ class IndirectILLReductionQENS(PythonAlgorithm):
 
         if xstart > 0:
             self.log().debug('Mask bins smaller than {0}'.format(xstart))
-            MaskBins(InputWorkspace=ws, OutputWorkspace=ws, XMin=x_values[0], XMax=x_values[xstart])
+            MaskBins(InputWorkspace=ws, OutputWorkspace=ws, XMin=x_values[0], XMax=x_values[int(xstart)])
 
         if xend < len(x_values) - 1:
             self.log().debug('Mask bins larger than {0}'.format(xend))
-            MaskBins(InputWorkspace=ws, OutputWorkspace=ws, XMin=x_values[xend + 1], XMax=x_values[-1])
+            MaskBins(InputWorkspace=ws, OutputWorkspace=ws, XMin=x_values[int(xend) + 1], XMax=x_values[-1])
 
     def _filter_files(self, files, label):
         '''
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSDarkRunBackgroundCorrection.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSDarkRunBackgroundCorrection.py
index 11018387d54f6eec1b61d216009c09502e98742b..f3c234e227029561dff91a48541314c1869e99e3 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSDarkRunBackgroundCorrection.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSDarkRunBackgroundCorrection.py
@@ -1,4 +1,4 @@
-#pylint: disable=no-init,invalid-name,too-many-locals,too-many-branches
+#pylint: disable=no-init,invalid-name,too-many-locals,too-many-branches
 from __future__ import (absolute_import, division, print_function)
 
 from mantid.simpleapi import *
diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSStitch.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSStitch.py
index 40dc0bd69689b55c7c9c41b0e900dd8ece238669..4cc5ad0f1f3068c3d263b011525f99b84dd20a17 100644
--- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSStitch.py
+++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSStitch.py
@@ -1,4 +1,4 @@
-# pylint: disable=no-init,invalid-name,too-many-arguments,too-few-public-methods
+# pylint: disable=no-init,invalid-name,too-many-arguments,too-few-public-methods
 
 from __future__ import (absolute_import, division, print_function)
 
diff --git a/Framework/PythonInterface/test/python/mantid/SimpleAPITest.py b/Framework/PythonInterface/test/python/mantid/SimpleAPITest.py
index e1dcd36d64242c00c40535f870f3ff92084d83c5..f7f6788755051c37b980d74036d3df99bf70a813 100644
--- a/Framework/PythonInterface/test/python/mantid/SimpleAPITest.py
+++ b/Framework/PythonInterface/test/python/mantid/SimpleAPITest.py
@@ -173,7 +173,7 @@ IgnoreBinErrors(Input) *boolean*       Ignore errors related to zero/negative bi
         self.assertTrue( wsname in mtd )
         self.assertTrue( wsname_box in mtd )
         
-        self.assertTrue( type(query) == tuple )
+        self.assertTrue( isinstance(query, tuple) )
         self.assertEquals( 2, len(query) )
         
         self.assertTrue( isinstance(query[0], ITableWorkspace) )
diff --git a/Framework/PythonInterface/test/python/mantid/api/RunTest.py b/Framework/PythonInterface/test/python/mantid/api/RunTest.py
index 951759cf721911ed5c9f871047f37d5e33ccbf5c..542b18da10272a95b7a9b5757f61a16c0fd52671 100644
--- a/Framework/PythonInterface/test/python/mantid/api/RunTest.py
+++ b/Framework/PythonInterface/test/python/mantid/api/RunTest.py
@@ -1,4 +1,4 @@
-from __future__ import (absolute_import, division, print_function)
+from __future__ import (absolute_import, division, print_function)
 
 import unittest
 from testhelpers import run_algorithm
diff --git a/Framework/PythonInterface/test/python/mantid/kernel/PropertyManagerPropertyTest.py b/Framework/PythonInterface/test/python/mantid/kernel/PropertyManagerPropertyTest.py
index e6f5a8b87483b9bab342978ebb47126eb06542f4..ce343b6563ea61ba8f23bde61e7773ae0181a217 100644
--- a/Framework/PythonInterface/test/python/mantid/kernel/PropertyManagerPropertyTest.py
+++ b/Framework/PythonInterface/test/python/mantid/kernel/PropertyManagerPropertyTest.py
@@ -1,4 +1,4 @@
-"""Test the exposed PropertyManagerProperty
+"""Test the exposed PropertyManagerProperty
 """
 from __future__ import (absolute_import, division, print_function)
 
diff --git a/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py b/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py
index f3c1174cb970b5d18bf08873fa1aab090ad37975..44f6d19c4b93c57d858bcc60b8a53cb7fb1897d6 100644
--- a/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py
+++ b/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py
@@ -3,7 +3,10 @@ from __future__ import (absolute_import, division, print_function)
 import unittest
 from mantid.kernel import *
 from mantid.api import *
-from mantid.simpleapi import Load, ConvertUnits, SplineInterpolation, ApplyPaalmanPingsCorrection, DeleteWorkspace
+from mantid.simpleapi import (CreateWorkspace, Load, ConvertUnits,
+                              SplineInterpolation, ApplyPaalmanPingsCorrection,
+                              DeleteWorkspace)
+import numpy
 
 
 class ApplyPaalmanPingsCorrectionTest(unittest.TestCase):
@@ -60,7 +63,7 @@ class ApplyPaalmanPingsCorrectionTest(unittest.TestCase):
         Do validation on a correction workspace.
 
         @param ws Workspace to validate
-        @param correction_type Type of correction that should hav ebeen applied
+        @param correction_type Type of correction that should have been applied
         """
 
         # X axis should be in wavelength
@@ -130,6 +133,63 @@ class ApplyPaalmanPingsCorrectionTest(unittest.TestCase):
 
         self._verify_workspace(corr, 'sample_and_can_corrections')
 
+    def test_container_input_workspace_not_unintentionally_rebinned(self):
+        xs = numpy.array([0.0, 1.0, 0.0, 1.1])
+        ys = numpy.array([2.2, 3.3])
+        sample_1 = CreateWorkspace(DataX=xs, DataY=ys, NSpec=2,
+                                   UnitX='Wavelength')
+        ys = numpy.array([0.11, 0.22])
+        container_1 = CreateWorkspace(DataX=xs, DataY=ys, NSpec=2,
+                                      UnitX='Wavelength')
+        corrected = ApplyPaalmanPingsCorrection(SampleWorkspace=sample_1,
+                                                CanWorkspace=container_1)
+        numHisto = container_1.getNumberHistograms()
+        for i in range(numHisto):
+            container_xs = container_1.readX(i)
+            for j in range(len(container_xs)):
+                self.assertEqual(container_xs[j], xs[i * numHisto + j])
+        DeleteWorkspace(sample_1)
+        DeleteWorkspace(container_1)
+        DeleteWorkspace(corrected)
+
+    def test_container_rebinning_enabled(self):
+        xs = numpy.array([0.0, 1.0, 0.0, 1.1])
+        ys = numpy.array([2.2, 3.3])
+        sample_1 = CreateWorkspace(DataX=xs, DataY=ys, NSpec=2,
+                                   UnitX='Wavelength')
+        xs = numpy.array([-1.0, 0.0, 1.0, 2.0, -1.0, 0.0, 1.0, 2.0])
+        ys = numpy.array([0.101, 0.102, 0.103, 0.104, 0.105, 0.106])
+        container_1 = CreateWorkspace(DataX=xs, DataY=ys, NSpec=2,
+                                      UnitX='Wavelength')
+        corrected = ApplyPaalmanPingsCorrection(SampleWorkspace=sample_1,
+                                                CanWorkspace=container_1,
+                                                RebinCanToSample=True)
+        self.assertTrue(numpy.all(sample_1.extractY() > corrected.extractY()))
+        DeleteWorkspace(sample_1)
+        DeleteWorkspace(container_1)
+        DeleteWorkspace(corrected)
+
+    def test_container_rebinning_disabled(self):
+        xs = numpy.array([0.0, 1.0, 0.0, 1.1])
+        ys = numpy.array([2.2, 3.3])
+        sample_1 = CreateWorkspace(DataX=xs, DataY=ys, NSpec=2,
+                                   UnitX='Wavelength')
+        xs = numpy.array([-1.0, 0.0, 1.0, 2.0, -1.0, 0.0, 1.0, 2.0])
+        ys = numpy.array([0.101, 0.102, 0.103, 0.104, 0.105, 0.106])
+        container_1 = CreateWorkspace(DataX=xs, DataY=ys, NSpec=2,
+                                      UnitX='Wavelength')
+        corrected_ws_name = 'corrected_workspace'
+        kwargs = {
+            'SampleWorkspace': sample_1,
+            'CanWorkspace': container_1,
+            'OutputWorkspaced': corrected_ws_name,
+            'RebinCanToSample': False
+        }
+        # The Minus algorithm will fail due to different bins in sample and
+        # container.
+        self.assertRaises(RuntimeError, ApplyPaalmanPingsCorrection, **kwargs)
+        DeleteWorkspace(sample_1)
+        DeleteWorkspace(container_1)
 
 if __name__=="__main__":
     unittest.main()
diff --git a/Framework/PythonInterface/test/python/plugins/algorithms/BinWidthAtXTest.py b/Framework/PythonInterface/test/python/plugins/algorithms/BinWidthAtXTest.py
index acd520ce090849653fe8a5ede1fa6acd878dd903..9f399c712493db22d623b4bf7efcc4dcf00c83d8 100644
--- a/Framework/PythonInterface/test/python/plugins/algorithms/BinWidthAtXTest.py
+++ b/Framework/PythonInterface/test/python/plugins/algorithms/BinWidthAtXTest.py
@@ -28,7 +28,7 @@ class BinWidthAtXTest(unittest.TestCase):
         xs = self._make_boundaries(xBegin, binWidths)
         ys = numpy.zeros(len(xs) - 1)
         ws = CreateWorkspace(DataX=xs, DataY=ys)
-        i = len(binWidths) / 2
+        i = len(binWidths) // 2
         middleBinWidth = binWidths[i]
         middleBinX = xs[i] + 0.5 * middleBinWidth
         return ws, middleBinX, middleBinWidth
diff --git a/Framework/PythonInterface/test/python/plugins/algorithms/MuscatSofQWTest.py b/Framework/PythonInterface/test/python/plugins/algorithms/MuscatSofQWTest.py
index 31f9673ba119d71718f17d515d37bd49946c8426..e67a0743f4572da08bdcbf7205560186c0ba38b6 100644
--- a/Framework/PythonInterface/test/python/plugins/algorithms/MuscatSofQWTest.py
+++ b/Framework/PythonInterface/test/python/plugins/algorithms/MuscatSofQWTest.py
@@ -37,7 +37,7 @@ class MuscatSofQWTest(unittest.TestCase):
         x_data = sqw_ws.dataX(0)
         self.assertAlmostEqual(x_data[0], -0.5)
         self.assertAlmostEqual(x_data[-1], 0.5)
-        self.assertAlmostEqual(x_data[len(x_data)/2], 0.0)
+        self.assertAlmostEqual(x_data[len(x_data)//2], 0.0)
 
         self.assertEquals(sqw_ws.blocksize(), 200)
 
@@ -59,7 +59,7 @@ class MuscatSofQWTest(unittest.TestCase):
         x_data = sqw_ws.dataX(0)
         self.assertAlmostEqual(x_data[0], -1.0)
         self.assertAlmostEqual(x_data[-1], 1.0)
-        self.assertAlmostEqual(x_data[len(x_data)/2], 0.0)
+        self.assertAlmostEqual(x_data[len(x_data)//2], 0.0)
 
         self.assertEquals(sqw_ws.blocksize(), 400)
 
@@ -81,7 +81,7 @@ class MuscatSofQWTest(unittest.TestCase):
         x_data = sqw_ws.dataX(0)
         self.assertAlmostEqual(x_data[0], -0.5)
         self.assertAlmostEqual(x_data[-1], 0.5)
-        self.assertAlmostEqual(x_data[len(x_data)/2], 0.0)
+        self.assertAlmostEqual(x_data[len(x_data)//2], 0.0)
 
         self.assertEquals(sqw_ws.blocksize(), 10)
 
diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiSpectrumDomainFunction.h b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiSpectrumDomainFunction.h
index 2462388f2261513d9c329a430acad0a3f937dac2..e57e64b294f0e923799632632d601aceaf91b275 100644
--- a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiSpectrumDomainFunction.h
+++ b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiSpectrumDomainFunction.h
@@ -1,19 +1,18 @@
 #ifndef MANTID_SINQ_POLDISPECTRUMDOMAINFUNCTION_H_
 #define MANTID_SINQ_POLDISPECTRUMDOMAINFUNCTION_H_
 
-#include "MantidSINQ/DllConfig.h"
+#include "MantidAPI/FunctionDomain1D.h"
 #include "MantidAPI/FunctionParameterDecorator.h"
 #include "MantidAPI/IFunction1DSpectrum.h"
-#include "MantidAPI/FunctionDomain1D.h"
-#include <string>
-
 #include "MantidAPI/IPeakFunction.h"
+#include "MantidDataObjects/Workspace2D.h"
+#include "MantidSINQ/DllConfig.h"
 #include "MantidSINQ/PoldiUtilities/IPoldiFunction1D.h"
+#include "MantidSINQ/PoldiUtilities/PoldiConversions.h"
 #include "MantidSINQ/PoldiUtilities/PoldiInstrumentAdapter.h"
 #include "MantidSINQ/PoldiUtilities/PoldiTimeTransformer.h"
 
-#include "MantidDataObjects/Workspace2D.h"
-#include "MantidSINQ/PoldiUtilities/PoldiConversions.h"
+#include <string>
 
 namespace Mantid {
 namespace Poldi {
diff --git a/Framework/SINQ/src/PoldiUtilities/PoldiSpectrumDomainFunction.cpp b/Framework/SINQ/src/PoldiUtilities/PoldiSpectrumDomainFunction.cpp
index 3f9f01e1ece8880868666f41e2c0812c43c70af3..8e0efaba1b7350ea2fcc8bd13c29f4ac263adcb5 100644
--- a/Framework/SINQ/src/PoldiUtilities/PoldiSpectrumDomainFunction.cpp
+++ b/Framework/SINQ/src/PoldiUtilities/PoldiSpectrumDomainFunction.cpp
@@ -1,11 +1,11 @@
 #include "MantidSINQ/PoldiUtilities/PoldiSpectrumDomainFunction.h"
 
+#include "MantidAPI/FunctionDomain1D.h"
 #include "MantidAPI/FunctionFactory.h"
 #include "MantidAPI/Workspace.h"
 #include "MantidDataObjects/Workspace2D.h"
-#include <stdexcept>
 
-#include "MantidAPI/FunctionDomain1D.h"
+#include <stdexcept>
 
 namespace Mantid {
 namespace Poldi {
@@ -191,7 +191,8 @@ void PoldiSpectrumDomainFunction::init() {}
  */
 void PoldiSpectrumDomainFunction::initializeParametersFromWorkspace(
     const Workspace2D_const_sptr &workspace2D) {
-  m_deltaT = workspace2D->readX(0)[1] - workspace2D->readX(0)[0];
+  const auto &xVals = workspace2D->x(0);
+  m_deltaT = xVals[1] - xVals[0];
 
   PoldiInstrumentAdapter_sptr adapter =
       boost::make_shared<PoldiInstrumentAdapter>(workspace2D->getInstrument(),
diff --git a/Framework/SINQ/src/PoldiUtilities/PoldiSpectrumLinearBackground.cpp b/Framework/SINQ/src/PoldiUtilities/PoldiSpectrumLinearBackground.cpp
index b091e8fea05f4d08ae30c84df4174f40061ba8fa..739456e1f62e595d096cf07bacade55a9fe3ad8d 100644
--- a/Framework/SINQ/src/PoldiUtilities/PoldiSpectrumLinearBackground.cpp
+++ b/Framework/SINQ/src/PoldiUtilities/PoldiSpectrumLinearBackground.cpp
@@ -1,4 +1,5 @@
 #include "MantidSINQ/PoldiUtilities/PoldiSpectrumLinearBackground.h"
+
 #include "MantidAPI/FunctionFactory.h"
 #include "MantidAPI/MatrixWorkspace.h"
 
@@ -20,7 +21,7 @@ void PoldiSpectrumLinearBackground::setWorkspace(
       boost::dynamic_pointer_cast<const MatrixWorkspace>(ws);
 
   if (matrixWs && matrixWs->getNumberHistograms() > 0) {
-    m_timeBinCount = matrixWs->readX(0).size();
+    m_timeBinCount = matrixWs->x(0).size();
   }
 }
 
diff --git a/Framework/SINQ/test/PoldiFitPeaks1D2Test.h b/Framework/SINQ/test/PoldiFitPeaks1D2Test.h
index febeb266721c0bedfa8556b8b0119a8360ee2d9c..e4fd2201eee32641c28a63a02a8a15f51a061978 100644
--- a/Framework/SINQ/test/PoldiFitPeaks1D2Test.h
+++ b/Framework/SINQ/test/PoldiFitPeaks1D2Test.h
@@ -309,7 +309,7 @@ private:
 
     // put it into a workspace
     Workspace2D_sptr ws =
-        WorkspaceCreationHelper::create1DWorkspaceConstant(50, 0.0, 1.0);
+        WorkspaceCreationHelper::create1DWorkspaceConstant(50, 0.0, 1.0, false);
     std::vector<double> &x = ws->dataX(0);
     std::vector<double> &y = ws->dataY(0);
 
diff --git a/Framework/SINQ/test/PoldiIndexKnownCompoundsTest.h b/Framework/SINQ/test/PoldiIndexKnownCompoundsTest.h
index 9541840e11ce5775cd96f518491c187edb28b2c5..b0906c2fa9120d39198de4f436770f27634718fd 100644
--- a/Framework/SINQ/test/PoldiIndexKnownCompoundsTest.h
+++ b/Framework/SINQ/test/PoldiIndexKnownCompoundsTest.h
@@ -239,7 +239,8 @@ public:
     std::vector<Workspace_sptr> badWorkspaces;
     badWorkspaces.push_back(
         PoldiPeakCollectionHelpers::createPoldiPeakTableWorkspace());
-    badWorkspaces.push_back(WorkspaceCreationHelper::create1DWorkspaceRand(10));
+    badWorkspaces.push_back(
+        WorkspaceCreationHelper::create1DWorkspaceRand(10, true));
 
     TS_ASSERT_THROWS(alg.getPeakCollections(badWorkspaces),
                      std::invalid_argument);
@@ -670,7 +671,7 @@ private:
   void storeRandomWorkspaces(const std::vector<std::string> &wsNames) {
     for (auto it = wsNames.begin(); it != wsNames.end(); ++it) {
       WorkspaceCreationHelper::storeWS(
-          *it, WorkspaceCreationHelper::create1DWorkspaceRand(10));
+          *it, WorkspaceCreationHelper::create1DWorkspaceRand(10, true));
     }
   }
 
diff --git a/Framework/SINQ/test/PoldiSpectrumDomainFunctionTest.h b/Framework/SINQ/test/PoldiSpectrumDomainFunctionTest.h
index 2531f48cd5c5b4b92239502438b4ab8d13564cf3..7e4467f8c89a470a88c25aa05045a480d6f3e0b9 100644
--- a/Framework/SINQ/test/PoldiSpectrumDomainFunctionTest.h
+++ b/Framework/SINQ/test/PoldiSpectrumDomainFunctionTest.h
@@ -1,16 +1,16 @@
 #ifndef MANTID_SINQ_POLDISPECTRUMDOMAINFUNCTIONTEST_H_
 #define MANTID_SINQ_POLDISPECTRUMDOMAINFUNCTIONTEST_H_
 
-#include <cxxtest/TestSuite.h>
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-
-#include "MantidSINQ/PoldiUtilities/PoldiSpectrumDomainFunction.h"
-#include "MantidSINQ/PoldiUtilities/PoldiMockInstrumentHelpers.h"
-#include "MantidSINQ/PoldiUtilities/PoldiInstrumentAdapter.h"
 #include "MantidAPI/FunctionFactory.h"
 #include "MantidAPI/MultiDomainFunction.h"
 #include "MantidCurveFitting/Jacobian.h"
+#include "MantidSINQ/PoldiUtilities/PoldiInstrumentAdapter.h"
+#include "MantidSINQ/PoldiUtilities/PoldiMockInstrumentHelpers.h"
+#include "MantidSINQ/PoldiUtilities/PoldiSpectrumDomainFunction.h"
+
+#include <cxxtest/TestSuite.h>
+#include <gtest/gtest.h>
+#include <gmock/gmock.h>
 
 using ::testing::Return;
 
diff --git a/Framework/SINQ/test/PoldiSpectrumLinearBackgroundTest.h b/Framework/SINQ/test/PoldiSpectrumLinearBackgroundTest.h
index 71120c01cec2eda4f37ceea05983abd52f553caa..a0a8cc3c8b005c4c59ea7ce5bd2e4f629c5a21ea 100644
--- a/Framework/SINQ/test/PoldiSpectrumLinearBackgroundTest.h
+++ b/Framework/SINQ/test/PoldiSpectrumLinearBackgroundTest.h
@@ -1,17 +1,16 @@
 #ifndef MANTID_SINQ_POLDISPECTRUMLINEARBACKGROUNDTEST_H_
 #define MANTID_SINQ_POLDISPECTRUMLINEARBACKGROUNDTEST_H_
 
-#include <cxxtest/TestSuite.h>
-
 #include "MantidSINQ/PoldiUtilities/PoldiSpectrumLinearBackground.h"
 
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/FunctionFactory.h"
 #include "MantidAPI/AlgorithmManager.h"
-
 #include "MantidCurveFitting/Jacobian.h"
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
 
+#include <cxxtest/TestSuite.h>
+
 using namespace Mantid::Poldi;
 using namespace Mantid::API;
 
diff --git a/Framework/TestHelpers/inc/MantidTestHelpers/WorkspaceCreationHelper.h b/Framework/TestHelpers/inc/MantidTestHelpers/WorkspaceCreationHelper.h
index 15e2dbd541ee9541567a6adc55501e1934426365..68b9df87227bcde59b8b1eafff22329b25cdf865 100644
--- a/Framework/TestHelpers/inc/MantidTestHelpers/WorkspaceCreationHelper.h
+++ b/Framework/TestHelpers/inc/MantidTestHelpers/WorkspaceCreationHelper.h
@@ -38,7 +38,7 @@ class PeaksWorkspace;
 }
 
 namespace WorkspaceCreationHelper {
-/// Create a fibonacci series
+/// Create a Fibonacci series
 template <typename T> struct FibSeries {
 private:
   T x1; /// Initial value 1;
@@ -111,13 +111,20 @@ template <typename T> boost::shared_ptr<T> getWS(const std::string &name) {
   return Mantid::API::AnalysisDataService::Instance().retrieveWS<T>(name);
 }
 
-Mantid::DataObjects::Workspace2D_sptr create1DWorkspaceRand(int size);
+/// Creates and returns point or bin based histograms with the data specified in
+/// parameters
+template <typename YType, typename EType>
+Mantid::HistogramData::Histogram createHisto(bool isHistogram, YType &&yAxis,
+                                             EType &&eAxis);
+Mantid::DataObjects::Workspace2D_sptr create1DWorkspaceRand(int size,
+                                                            bool isHisto);
 Mantid::DataObjects::Workspace2D_sptr
-create1DWorkspaceConstant(int size, double value, double error);
-Mantid::DataObjects::Workspace2D_sptr create1DWorkspaceFib(int size);
+create1DWorkspaceConstant(int size, double value, double error, bool isHisto);
+Mantid::DataObjects::Workspace2D_sptr create1DWorkspaceFib(int size,
+                                                           bool isHisto);
 Mantid::DataObjects::Workspace2D_sptr
 create1DWorkspaceConstantWithXerror(int size, double value, double error,
-                                    double xError);
+                                    double xError, bool isHisto = true);
 Mantid::DataObjects::Workspace2D_sptr create2DWorkspace(int nhist,
                                                         int numBoundaries);
 Mantid::DataObjects::Workspace2D_sptr
@@ -145,7 +152,7 @@ Mantid::API::WorkspaceGroup_sptr createWorkspaceGroup(int nEntries, int nHist,
  * Filled with Y = 2.0 and E = sqrt(2.0)w
  */
 Mantid::DataObjects::Workspace2D_sptr
-create2DWorkspaceBinned(int nhist, int nbins, double x0 = 0.0,
+create2DWorkspaceBinned(int nhist, int numVals, double x0 = 0.0,
                         double deltax = 1.0);
 
 /** Create a 2D workspace with this many histograms and bins. The bins are
@@ -182,9 +189,9 @@ create2DWorkspaceFromFunction(Func f, int nSpec, double x0, double x1,
                                                        nY));
 
   for (int iSpec = 0; iSpec < nSpec; iSpec++) {
-    Mantid::MantidVec &X = ws->dataX(iSpec);
-    Mantid::MantidVec &Y = ws->dataY(iSpec);
-    Mantid::MantidVec &E = ws->dataE(iSpec);
+    auto &X = ws->mutableX(iSpec);
+    auto &Y = ws->mutableY(iSpec);
+    auto &E = ws->mutableE(iSpec);
     for (int i = 0; i < nY; i++) {
       double x = x0 + dx * i;
       X[i] = x;
@@ -331,11 +338,17 @@ createEventWorkspace3(Mantid::DataObjects::EventWorkspace_const_sptr sourceWS,
 /// Function to create a fixed RebinnedOutput workspace
 Mantid::DataObjects::RebinnedOutput_sptr createRebinnedOutputWorkspace();
 
+/// Populates a mutable reference from initializer list starting at user
+/// specified index
+template <typename T>
+void populateWsWithInitList(T &destination, size_t startingIndex,
+                            const std::initializer_list<double> &values);
+
 /// Create a simple peaks workspace containing the given number of peaks
 boost::shared_ptr<Mantid::DataObjects::PeaksWorkspace>
 createPeaksWorkspace(const int numPeaks = 2,
                      const bool createOrientedLattice = false);
-/**Build table workspace with preprocessed detectors for existign worksapce with
+/**Build table workspace with preprocessed detectors for existing workspace with
  * instrument */
 boost::shared_ptr<Mantid::DataObjects::TableWorkspace>
 buildPreprocessedDetectorsWorkspace(Mantid::API::MatrixWorkspace_sptr ws);
diff --git a/Framework/TestHelpers/src/MultiDomainFunctionHelper.cpp b/Framework/TestHelpers/src/MultiDomainFunctionHelper.cpp
index a9cdf7b934bc074a5500c2824acb2791a501c723..9e5d5dac75464a99be96dc58981f467cbc4e5cdd 100644
--- a/Framework/TestHelpers/src/MultiDomainFunctionHelper.cpp
+++ b/Framework/TestHelpers/src/MultiDomainFunctionHelper.cpp
@@ -101,16 +101,12 @@ const double dX = 0.2;
 Mantid::API::MatrixWorkspace_sptr makeMultiDomainWorkspace1() {
   Mantid::API::MatrixWorkspace_sptr ws1 = boost::make_shared<WorkspaceTester>();
   ws1->initialize(1, nbins, nbins);
-  {
-    Mantid::MantidVec &x = ws1->dataX(0);
-    Mantid::MantidVec &y = ws1->dataY(0);
-    // Mantid::MantidVec& e = ws1->dataE(0);
-    for (size_t i = 0; i < ws1->blocksize(); ++i) {
-      x[i] = -1.0 + dX * double(i);
-      const double t = x[i];
-      y[i] =
-          A0 + B0 * t + (A1 + B1 * t) * pow(t, 2) + (A2 + B2 * t) * pow(t, 4);
-    }
+  auto &x = ws1->mutableX(0);
+  auto &y = ws1->mutableY(0);
+  for (size_t i = 0; i < ws1->blocksize(); ++i) {
+    x[i] = -1.0 + dX * double(i);
+    const double t = x[i];
+    y[i] = A0 + B0 * t + (A1 + B1 * t) * pow(t, 2) + (A2 + B2 * t) * pow(t, 4);
   }
 
   return ws1;
@@ -119,15 +115,13 @@ Mantid::API::MatrixWorkspace_sptr makeMultiDomainWorkspace1() {
 Mantid::API::MatrixWorkspace_sptr makeMultiDomainWorkspace2() {
   Mantid::API::MatrixWorkspace_sptr ws2 = boost::make_shared<WorkspaceTester>();
   ws2->initialize(1, nbins, nbins);
-  {
-    Mantid::MantidVec &x = ws2->dataX(0);
-    Mantid::MantidVec &y = ws2->dataY(0);
-    // Mantid::MantidVec& e = ws2->dataE(0);
-    for (size_t i = 0; i < ws2->blocksize(); ++i) {
-      x[i] = -1.0 + dX * double(i);
-      const double t = x[i];
-      y[i] = A0 + B0 * t + (A1 + B1 * t) * pow(t, 2);
-    }
+
+  auto &x = ws2->mutableX(0);
+  auto &y = ws2->mutableY(0);
+  for (size_t i = 0; i < ws2->blocksize(); ++i) {
+    x[i] = -1.0 + dX * double(i);
+    const double t = x[i];
+    y[i] = A0 + B0 * t + (A1 + B1 * t) * pow(t, 2);
   }
 
   return ws2;
@@ -136,15 +130,12 @@ Mantid::API::MatrixWorkspace_sptr makeMultiDomainWorkspace2() {
 Mantid::API::MatrixWorkspace_sptr makeMultiDomainWorkspace3() {
   Mantid::API::MatrixWorkspace_sptr ws3 = boost::make_shared<WorkspaceTester>();
   ws3->initialize(1, nbins, nbins);
-  {
-    Mantid::MantidVec &x = ws3->dataX(0);
-    Mantid::MantidVec &y = ws3->dataY(0);
-    // Mantid::MantidVec& e = ws3->dataE(0);
-    for (size_t i = 0; i < ws3->blocksize(); ++i) {
-      x[i] = -1.0 + dX * double(i);
-      const double t = x[i];
-      y[i] = A0 + B0 * t + (A2 + B2 * t) * pow(t, 4);
-    }
+  auto &x = ws3->mutableX(0);
+  auto &y = ws3->mutableY(0);
+  for (size_t i = 0; i < ws3->blocksize(); ++i) {
+    x[i] = -1.0 + dX * double(i);
+    const double t = x[i];
+    y[i] = A0 + B0 * t + (A2 + B2 * t) * pow(t, 4);
   }
 
   return ws3;
diff --git a/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp b/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp
index c41fcaa7b3f378cbf2402ce35fe8ac9cb05cc575..d7f07bd6724b72474b783c5698ba1b1738b26ac7 100644
--- a/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp
+++ b/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp
@@ -23,6 +23,7 @@
 #include "MantidAPI/NumericAxis.h"
 #include "MantidAPI/WorkspaceGroup.h"
 #include "MantidDataObjects/PeaksWorkspace.h"
+#include "MantidDataObjects/WorkspaceCreation.h"
 #include "MantidGeometry/Instrument/Detector.h"
 #include "MantidGeometry/Instrument/Goniometer.h"
 #include "MantidGeometry/Instrument/ParameterMap.h"
@@ -74,54 +75,78 @@ void removeWS(const std::string &name) {
   Mantid::API::AnalysisDataService::Instance().remove(name);
 }
 
-Workspace2D_sptr create1DWorkspaceRand(int size) {
-  MantidVec y1(size);
-  MantidVec e1(size);
+/**
+  * Creates bin or point based histograms based on the data passed
+  * in for Y and E values and the bool specified.
+  *
+  * @param isHistogram :: Specifies whether the returned histogram
+  * should use points or bin edges for the x axis. True gives bin edges.
+  * @param yAxis :: Takes an rvalue (move) of the y axis for the new histogram
+  * @param eAxis :: Takes an rvalue (move) of the e axis for the new histogram
+  *
+  * @return :: Returns a histogram with the user specified X axis type
+  * and the data the user passed in.
+  */
+template <typename YType, typename EType>
+Histogram createHisto(bool isHistogram, YType &&yAxis, EType &&eAxis) {
+  // We don't need to check if y.size() == e.size() as the histogram
+  // type does this at construction
+  const size_t yValsSize = yAxis.size();
+  if (isHistogram) {
+    BinEdges xAxis(yValsSize + 1, LinearGenerator(1, 1));
+    Histogram histo{std::move(xAxis), std::move(yAxis), std::move(eAxis)};
+    return histo;
+  } else {
+    Points xAxis(yValsSize, LinearGenerator(1, 1));
+    Histogram pointsHisto{std::move(xAxis), std::move(yAxis), std::move(eAxis)};
+    return pointsHisto;
+  }
+}
+
+Workspace2D_sptr create1DWorkspaceRand(int size, bool isHisto) {
 
   MersenneTwister randomGen(DateAndTime::getCurrentTime().nanoseconds(), 0,
                             std::numeric_limits<int>::max());
+
   auto randFunc = [&randomGen] { return randomGen.nextValue(); };
+  Counts counts(size, randFunc);
+  CountStandardDeviations errorVals(size, randFunc);
 
-  std::generate(y1.begin(), y1.end(), randFunc);
-  std::generate(e1.begin(), e1.end(), randFunc);
+  auto generatedHisto = createHisto(isHisto, counts, errorVals);
   auto retVal = boost::make_shared<Workspace2D>();
-  retVal->initialize(1, size, size);
-  retVal->setPoints(0, size, LinearGenerator(1.0, 1.0));
-  retVal->dataY(0) = y1;
-  retVal->dataE(0) = e1;
+  retVal->initialize(1, std::move(generatedHisto));
   return retVal;
 }
 
-Workspace2D_sptr create1DWorkspaceConstant(int size, double value,
-                                           double error) {
-  MantidVec y1(size, value);
-  MantidVec e1(size, error);
+Workspace2D_sptr create1DWorkspaceConstant(int size, double value, double error,
+                                           bool isHisto) {
+  Counts yVals(size, value);
+  CountStandardDeviations errVals(size, error);
+  auto generatedHisto = createHisto(isHisto, yVals, errVals);
+
   auto retVal = boost::make_shared<Workspace2D>();
-  retVal->initialize(1, size, size);
-  retVal->setPoints(0, size, LinearGenerator(1.0, 1.0));
-  retVal->dataY(0) = y1;
-  retVal->dataE(0) = e1;
+  retVal->initialize(1, std::move(generatedHisto));
   return retVal;
 }
 
 Workspace2D_sptr create1DWorkspaceConstantWithXerror(int size, double value,
                                                      double error,
-                                                     double xError) {
-  auto ws = create1DWorkspaceConstant(size, value, error);
+                                                     double xError,
+                                                     bool isHisto) {
+  auto ws = create1DWorkspaceConstant(size, value, error, isHisto);
   auto dx1 = Kernel::make_cow<HistogramData::HistogramDx>(size, xError);
   ws->setSharedDx(0, dx1);
   return ws;
 }
 
-Workspace2D_sptr create1DWorkspaceFib(int size) {
-  MantidVec y1(size);
-  MantidVec e1(size);
-  std::generate(y1.begin(), y1.end(), FibSeries<double>());
+Workspace2D_sptr create1DWorkspaceFib(int size, bool isHisto) {
+  BinEdges xVals(size + 1, LinearGenerator(1, 1));
+  Counts yVals(size, FibSeries<double>());
+  CountStandardDeviations errVals(size);
+
+  auto generatedHisto = createHisto(isHisto, yVals, errVals);
   auto retVal = boost::make_shared<Workspace2D>();
-  retVal->initialize(1, size, size);
-  retVal->setPoints(0, size, LinearGenerator(1.0, 1.0));
-  retVal->dataY(0) = y1;
-  retVal->dataE(0) = e1;
+  retVal->initialize(1, std::move(generatedHisto));
   return retVal;
 }
 
@@ -138,9 +163,12 @@ Workspace2D_sptr create2DWorkspace(int nhist, int numBoundaries) {
 Workspace2D_sptr create2DWorkspaceWhereYIsWorkspaceIndex(int nhist,
                                                          int numBoundaries) {
   Workspace2D_sptr out = create2DWorkspaceBinned(nhist, numBoundaries);
-  for (int wi = 0; wi < nhist; wi++)
-    for (int x = 0; x < numBoundaries; x++)
-      out->dataY(wi)[x] = wi * 1.0;
+  for (int workspaceIndex = 0; workspaceIndex < nhist; workspaceIndex++) {
+    std::vector<double> yValues(numBoundaries,
+                                static_cast<double>(workspaceIndex));
+    out->mutableY(workspaceIndex) = std::move(yValues);
+  }
+
   return out;
 }
 
@@ -256,13 +284,13 @@ WorkspaceGroup_sptr createWorkspaceGroup(int nEntries, int nHist, int nBins,
 /** Create a 2D workspace with this many histograms and bins.
  * Filled with Y = 2.0 and E = M_SQRT2w
  */
-Workspace2D_sptr create2DWorkspaceBinned(int nhist, int nbins, double x0,
+Workspace2D_sptr create2DWorkspaceBinned(int nhist, int numVals, double x0,
                                          double deltax) {
-  BinEdges x(nbins + 1, LinearGenerator(x0, deltax));
-  Counts y(nbins, 2);
-  CountStandardDeviations e(nbins, M_SQRT2);
+  BinEdges x(numVals + 1, LinearGenerator(x0, deltax));
+  Counts y(numVals, 2);
+  CountStandardDeviations e(numVals, M_SQRT2);
   auto retVal = boost::make_shared<Workspace2D>();
-  retVal->initialize(nhist, nbins + 1, nbins);
+  retVal->initialize(nhist, numVals + 1, numVals);
   for (int i = 0; i < nhist; i++) {
     retVal->setBinEdges(i, x);
     retVal->setCounts(i, y);
@@ -303,11 +331,11 @@ void addNoise(Mantid::API::MatrixWorkspace_sptr ws, double noise,
   const size_t seed(12345);
   MersenneTwister randGen(seed, lower, upper);
   for (size_t iSpec = 0; iSpec < ws->getNumberHistograms(); iSpec++) {
-    Mantid::MantidVec &Y = ws->dataY(iSpec);
-    Mantid::MantidVec &E = ws->dataE(iSpec);
-    for (size_t i = 0; i < Y.size(); i++) {
-      Y[i] += noise * randGen.nextValue();
-      E[i] += noise;
+    auto &mutableY = ws->mutableY(iSpec);
+    auto &mutableE = ws->mutableE(iSpec);
+    for (size_t i = 0; i < mutableY.size(); i++) {
+      mutableY[i] += noise * randGen.nextValue();
+      mutableE[i] += noise;
     }
   }
 }
@@ -396,11 +424,12 @@ createEventWorkspaceWithFullInstrument(int numBanks, int numPixels,
   ws->setInstrument(inst);
 
   // Set the X axes
-  MantidVec x = ws->readX(0);
-  auto ax0 = new NumericAxis(x.size());
+  const auto &xVals = ws->x(0);
+  const size_t xSize = xVals.size();
+  auto ax0 = new NumericAxis(xSize);
   ax0->setUnit("dSpacing");
-  for (size_t i = 0; i < x.size(); i++) {
-    ax0->setValue(i, x[i]);
+  for (size_t i = 0; i < xSize; i++) {
+    ax0->setValue(i, xVals[i]);
   }
   ws->replaceAxis(0, ax0);
 
@@ -804,41 +833,44 @@ createGroupedWorkspace2DWithRingsAndBoxes(size_t RootOfNumHist, int numBins,
   return boost::dynamic_pointer_cast<MatrixWorkspace>(retVal);
 }
 
-// not strictly creating a workspace, but really helpfull to see what one
+// not strictly creating a workspace, but really helpful to see what one
 // contains
 void displayDataY(const MatrixWorkspace_sptr ws) {
   const size_t numHists = ws->getNumberHistograms();
   for (size_t i = 0; i < numHists; ++i) {
     std::cout << "Histogram " << i << " = ";
+    const auto &y = ws->y(i);
     for (size_t j = 0; j < ws->blocksize(); ++j) {
-      std::cout << ws->readY(i)[j] << " ";
+      std::cout << y[j] << " ";
     }
     std::cout << '\n';
   }
 }
 void displayData(const MatrixWorkspace_sptr ws) { displayDataX(ws); }
 
-// not strictly creating a workspace, but really helpfull to see what one
+// not strictly creating a workspace, but really helpful to see what one
 // contains
 void displayDataX(const MatrixWorkspace_sptr ws) {
   const size_t numHists = ws->getNumberHistograms();
   for (size_t i = 0; i < numHists; ++i) {
     std::cout << "Histogram " << i << " = ";
+    const auto &x = ws->x(i);
     for (size_t j = 0; j < ws->blocksize(); ++j) {
-      std::cout << ws->readX(i)[j] << " ";
+      std::cout << x[j] << " ";
     }
     std::cout << '\n';
   }
 }
 
-// not strictly creating a workspace, but really helpfull to see what one
+// not strictly creating a workspace, but really helpful to see what one
 // contains
 void displayDataE(const MatrixWorkspace_sptr ws) {
   const size_t numHists = ws->getNumberHistograms();
   for (size_t i = 0; i < numHists; ++i) {
     std::cout << "Histogram " << i << " = ";
+    const auto &e = ws->e(i);
     for (size_t j = 0; j < ws->blocksize(); ++j) {
-      std::cout << ws->readE(i)[j] << " ";
+      std::cout << e[j] << " ";
     }
     std::cout << '\n';
   }
@@ -966,18 +998,19 @@ createProcessedInelasticWS(const std::vector<double> &L2,
     //   spec->setSpectrumNo(g+1); // Match detector ID and spec NO
   }
 
-  double dE = (Emax - Emin) / double(numBins);
+  const double dE = (Emax - Emin) / static_cast<double>(numBins);
   for (size_t j = 0; j < numPixels; j++) {
-
-    MantidVec &E_transfer = ws->dataX(j);
+    std::vector<double> E_transfer;
+    E_transfer.reserve(numBins);
     for (size_t i = 0; i <= numBins; i++) {
-      double E = Emin + static_cast<double>(i) * dE;
-      E_transfer[i] = E;
+      E_transfer.push_back(Emin + static_cast<double>(i) * dE);
     }
+    ws->mutableX(j) = E_transfer;
   }
+
   // set axis, correspondent to the X-values
   auto pAxis0 = new NumericAxis(numBins);
-  MantidVec &E_transfer = ws->dataX(0);
+  const auto &E_transfer = ws->x(0);
   for (size_t i = 0; i < numBins; i++) {
     double E = 0.5 * (E_transfer[i] + E_transfer[i + 1]);
     pAxis0->setValue(i, E);
@@ -1085,11 +1118,8 @@ RebinnedOutput_sptr createRebinnedOutputWorkspace() {
   Mantid::API::AnalysisDataService::Instance().add("rebinTest", outputWS);
 
   // Set Q ('y') axis binning
-  MantidVec qbins;
-  qbins.push_back(0.0);
-  qbins.push_back(1.0);
-  qbins.push_back(4.0);
-  MantidVec qaxis;
+  std::vector<double> qbins{0.0, 1.0, 4.0};
+  std::vector<double> qaxis;
   const int numY =
       static_cast<int>(VectorHelper::createAxisFromRebinParams(qbins, qaxis));
 
@@ -1103,7 +1133,7 @@ RebinnedOutput_sptr createRebinnedOutputWorkspace() {
   outputWS->setYUnit("Counts");
   outputWS->setTitle("Empty_Title");
 
-  // Create the x-axis for histogramming.
+  // Create the i-axis for histogramming.
   HistogramData::BinEdges x1{-3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0};
 
   // Create a numeric axis to replace the default vertical one
@@ -1127,78 +1157,65 @@ RebinnedOutput_sptr createRebinnedOutputWorkspace() {
 
   // Now, setup the data
   // Q bin #1
-  outputWS->dataY(0)[1] = 2.0;
-  outputWS->dataY(0)[2] = 3.0;
-  outputWS->dataY(0)[3] = 3.0;
-  outputWS->dataY(0)[4] = 2.0;
-  outputWS->dataE(0)[1] = 2.0;
-  outputWS->dataE(0)[2] = 3.0;
-  outputWS->dataE(0)[3] = 3.0;
-  outputWS->dataE(0)[4] = 2.0;
-  outputWS->dataF(0)[1] = 2.0;
-  outputWS->dataF(0)[2] = 3.0;
-  outputWS->dataF(0)[3] = 3.0;
-  outputWS->dataF(0)[4] = 1.0;
+
+  // Populates destination starting at index 1 with the following data
+  // e.g. y(0)[1] = 2.0, y(0)[2] = 3.0 ..etc. as the starting index is 1
+  // if you change the values in the line below please update this comment!
+  populateWsWithInitList(outputWS->mutableY(0), 1, {2.0, 3.0, 3.0, 2.0});
+  populateWsWithInitList(outputWS->mutableE(0), 1, {2.0, 3.0, 3.0, 2.0});
+  populateWsWithInitList(outputWS->dataF(0), 1, {2.0, 3.0, 3.0, 1.0});
+
   // Q bin #2
-  outputWS->dataY(1)[1] = 1.0;
-  outputWS->dataY(1)[2] = 3.0;
-  outputWS->dataY(1)[3] = 3.0;
-  outputWS->dataY(1)[4] = 2.0;
-  outputWS->dataY(1)[5] = 2.0;
-  outputWS->dataE(1)[1] = 1.0;
-  outputWS->dataE(1)[2] = 3.0;
-  outputWS->dataE(1)[3] = 3.0;
-  outputWS->dataE(1)[4] = 2.0;
-  outputWS->dataE(1)[5] = 2.0;
-  outputWS->dataF(1)[1] = 1.0;
-  outputWS->dataF(1)[2] = 3.0;
-  outputWS->dataF(1)[3] = 3.0;
-  outputWS->dataF(1)[4] = 1.0;
-  outputWS->dataF(1)[5] = 2.0;
+  populateWsWithInitList(outputWS->mutableY(1), 1, {1.0, 3.0, 3.0, 2.0, 2.0});
+  populateWsWithInitList(outputWS->mutableE(1), 1, {1.0, 3.0, 3.0, 2.0, 2.0});
+  populateWsWithInitList(outputWS->dataF(1), 1, {1.0, 3.0, 3.0, 1.0, 2.0});
+
   // Q bin #3
-  outputWS->dataY(2)[1] = 1.0;
-  outputWS->dataY(2)[2] = 2.0;
-  outputWS->dataY(2)[3] = 3.0;
-  outputWS->dataY(2)[4] = 1.0;
-  outputWS->dataE(2)[1] = 1.0;
-  outputWS->dataE(2)[2] = 2.0;
-  outputWS->dataE(2)[3] = 3.0;
-  outputWS->dataE(2)[4] = 1.0;
-  outputWS->dataF(2)[1] = 1.0;
-  outputWS->dataF(2)[2] = 2.0;
-  outputWS->dataF(2)[3] = 2.0;
-  outputWS->dataF(2)[4] = 1.0;
+  populateWsWithInitList(outputWS->mutableY(2), 1, {1.0, 2.0, 3.0, 1.0});
+  populateWsWithInitList(outputWS->mutableE(2), 1, {1.0, 2.0, 3.0, 1.0});
+  populateWsWithInitList(outputWS->dataF(2), 1, {1.0, 2.0, 2.0, 1.0});
+
   // Q bin #4
-  outputWS->dataY(3)[0] = 1.0;
-  outputWS->dataY(3)[1] = 2.0;
-  outputWS->dataY(3)[2] = 3.0;
-  outputWS->dataY(3)[3] = 2.0;
-  outputWS->dataY(3)[4] = 1.0;
-  outputWS->dataE(3)[0] = 1.0;
-  outputWS->dataE(3)[1] = 2.0;
-  outputWS->dataE(3)[2] = 3.0;
-  outputWS->dataE(3)[3] = 2.0;
-  outputWS->dataE(3)[4] = 1.0;
-  outputWS->dataF(3)[0] = 1.0;
-  outputWS->dataF(3)[1] = 2.0;
-  outputWS->dataF(3)[2] = 3.0;
-  outputWS->dataF(3)[3] = 2.0;
-  outputWS->dataF(3)[4] = 1.0;
-  outputWS->dataF(3)[5] = 1.0;
+  populateWsWithInitList(outputWS->mutableY(3), 0, {1.0, 2.0, 3.0, 2.0, 1.0});
+  populateWsWithInitList(outputWS->mutableE(3), 0, {1.0, 2.0, 3.0, 2.0, 1.0});
+  populateWsWithInitList(outputWS->dataF(3), 0, {1.0, 2.0, 3.0, 2.0, 1.0, 1.0});
 
   // Set representation
   outputWS->finalize();
 
   // Make errors squared rooted
   for (int i = 0; i < numHist; ++i) {
+    auto &mutableE = outputWS->mutableE(i);
     for (int j = 0; j < numX - 1; ++j) {
-      outputWS->dataE(i)[j] = std::sqrt(outputWS->dataE(i)[j]);
+      mutableE[j] = std::sqrt(mutableE[j]);
     }
   }
 
   return outputWS;
 }
 
+/**
+  * Populates the destination array (usually a mutable histogram)
+  * starting at the index specified with the doubles provided in an
+  * initializer list. Note the caller is responsible for ensuring
+  * the destination has capacity for startingIndex + size(initializer list)
+  * number of values
+  *
+  * @param destination :: The array to populate with data
+  * @param startingIndex :: The index to start populating data at
+  * @param values :: The initializer list to populate the array with
+  * starting at the index specified
+  */
+template <typename T>
+void populateWsWithInitList(T &destination, size_t startingIndex,
+                            const std::initializer_list<double> &values) {
+  size_t index = 0;
+  for (const double val : values) {
+    destination[startingIndex + index] = val;
+    index++;
+  }
+}
+
 Mantid::DataObjects::PeaksWorkspace_sptr
 createPeaksWorkspace(const int numPeaks, const bool createOrientedLattice) {
   auto peaksWS = boost::make_shared<PeaksWorkspace>();
diff --git a/Framework/WorkflowAlgorithms/src/EQSANSLoad.cpp b/Framework/WorkflowAlgorithms/src/EQSANSLoad.cpp
index d4856dc438007b8bdffdc9ff661788c89d901052..3c0f79ddbcd526586662c17049e8c1c1b1fa9437 100644
--- a/Framework/WorkflowAlgorithms/src/EQSANSLoad.cpp
+++ b/Framework/WorkflowAlgorithms/src/EQSANSLoad.cpp
@@ -289,9 +289,10 @@ void EQSANSLoad::getSourceSlitSize() {
                                          "floating point values.");
   int slit3 = static_cast<int>(dp->getStatistics().mean);
 
-  if (slit1 < 0 && slit2 < 0 && slit3 < 0)
+  if (slit1 < 0 && slit2 < 0 && slit3 < 0) {
     m_output_message += "   Could not determine source aperture diameter\n";
-  return;
+    return;
+  }
 
   // Default slit size
   double S1 = 20.0;
diff --git a/Framework/WorkflowAlgorithms/src/RefReduction.cpp b/Framework/WorkflowAlgorithms/src/RefReduction.cpp
index 0bd630b4e806e19738676d27440a71bf182fcf58..6fe15811a44b297e6b80f234102d715163f5587b 100644
--- a/Framework/WorkflowAlgorithms/src/RefReduction.cpp
+++ b/Framework/WorkflowAlgorithms/src/RefReduction.cpp
@@ -14,6 +14,7 @@
 #include "Poco/File.h"
 #include "Poco/NumberFormatter.h"
 #include "Poco/String.h"
+#include <algorithm>
 
 namespace Mantid {
 namespace WorkflowAlgorithms {
@@ -308,10 +309,13 @@ MatrixWorkspace_sptr RefReduction::processData(const std::string polarization) {
   refAlg1->setProperty("ScatteringAngle", theta);
   refAlg1->executeAsChildAlg();
   MatrixWorkspace_sptr outputWS2 = refAlg1->getProperty("OutputWorkspace");
+  std::string polarizationTranslation(polarization);
+  std::replace(polarizationTranslation.begin(), polarizationTranslation.end(),
+               '-', '_');
   declareProperty(Kernel::make_unique<WorkspaceProperty<>>(
-      "OutputWorkspace_jc_" + polarization, "Lambda_" + polarization,
+      "OutputWorkspace_jc_" + polarizationTranslation, "Lambda_" + polarization,
       Direction::Output));
-  setProperty("OutputWorkspace_jc_" + polarization, outputWS2);
+  setProperty("OutputWorkspace_jc_" + polarizationTranslation, outputWS2);
 
   // Conversion to Q
   IAlgorithm_sptr refAlg = createChildAlgorithm("RefRoi", 0.90, 0.95);
@@ -352,12 +356,13 @@ MatrixWorkspace_sptr RefReduction::processData(const std::string polarization) {
     std::string wsName = prefix + polarization;
     Poco::replaceInPlace(wsName, "entry", "");
     declareProperty(Kernel::make_unique<WorkspaceProperty<>>(
-        "OutputWorkspace_" + polarization, wsName, Direction::Output));
-    setProperty("OutputWorkspace_" + polarization, outputWS);
+        "OutputWorkspace_" + polarizationTranslation, wsName,
+        Direction::Output));
+    setProperty("OutputWorkspace_" + polarizationTranslation, outputWS);
     declareProperty(Kernel::make_unique<WorkspaceProperty<>>(
-        "OutputWorkspace2D_" + polarization, "2D_" + wsName,
+        "OutputWorkspace2D_" + polarizationTranslation, "2D_" + wsName,
         Direction::Output));
-    setProperty("OutputWorkspace2D_" + polarization, output2DWS);
+    setProperty("OutputWorkspace2D_" + polarizationTranslation, output2DWS);
   }
   m_output_message += "Reflectivity calculation completed\n";
   return outputWS;
diff --git a/MantidPlot/pymantidplot/__init__.py b/MantidPlot/pymantidplot/__init__.py
index 10773313984e971b911cd50d6ec671fcdafd9453..85ea6f3ba4e87d92054c87e572f5ab0b7a2eb475 100644
--- a/MantidPlot/pymantidplot/__init__.py
+++ b/MantidPlot/pymantidplot/__init__.py
@@ -1,4 +1,4 @@
-"""
+"""
 MantidPlot module to gain access to plotting functions etc.
 Requires that the main script be run from within MantidPlot
 """
@@ -10,30 +10,36 @@ try:
 except ImportError:
     raise ImportError('The "mantidplot" module can only be used from within MantidPlot.')
 
+# -------------------------- WARNING!!!!!! -------------------------------
+# Be careful about adding/changing imports here. This whole module gets imported into the MantidPlot
+# namespace wholesale. This means that names that we don't want there should be hidden with the _ prefix.
+# User scripts may be accidentally dependent on these names without knowing about it and we shouldn't
+# break those.
 import pymantidplot.proxies as proxies
 from pymantidplot.proxies import threadsafe_call, new_proxy, getWorkspaceNames
 
 from PyQt4 import QtCore, QtGui
-from PyQt4.QtCore import Qt
+from PyQt4.QtCore import Qt # noqa
+import collections as _collections
 import os
 import time
 import mantid.api
 import mantidqtpython
-from mantidqtpython import GraphOptions
+from mantidqtpython import GraphOptions # noqa
 # historical names in MantidPlot
 from mantidqtpython import MantidQt as _MantidQt
 from six.moves import range
-InstrumentViewMaskTab = _MantidQt.MantidWidgets.InstrumentWidgetMaskTab
-InstrumentViewPickTab = _MantidQt.MantidWidgets.InstrumentWidgetPickTab
 
-# Import into the global namespace qti classes that:
 #   (a) don't need a proxy & (b) can be constructed from python or (c) have enumerations within them
-from _qti import (PlotSymbol, ImageSymbol, ArrowMarker, ImageMarker, InstrumentView)
+from _qti import (PlotSymbol, ImageSymbol, ArrowMarker, ImageMarker, InstrumentView) # noqa
 
 # Make the ApplicationWindow instance accessible from the mantidplot namespace
-from _qti import app
-
+from _qti import app # noqa
 
+# Aliases
+# Import into the global namespace qti classes that:
+InstrumentViewMaskTab = _MantidQt.MantidWidgets.InstrumentWidgetMaskTab
+InstrumentViewPickTab = _MantidQt.MantidWidgets.InstrumentWidgetPickTab
 # Alias threadsafe_call so users have a more understandable name
 gui_cmd = threadsafe_call
 
@@ -207,7 +213,7 @@ def newTiledWindow(name=None, sources = None, ncols = None):
     if ncols is None:
         ncols = proxy.columnCount()
 
-    if not sources is None:
+    if sources is not None:
         row = 0
         col = 0
         for source in sources:
@@ -260,7 +266,7 @@ def plotSpectrum(source, indices, distribution = mantidqtpython.MantidQt.Distrib
                                  " number of spectra in this workspace - 1 (%d)" % (name, idx, max_spec))
 
     # Unwrap the window object, if any specified
-    if window != None:
+    if window is not None:
         window = window._getHeldObject()
 
     graph = proxies.Graph(threadsafe_call(_qti.app.mantidUI.plot1D,
@@ -357,7 +363,7 @@ def plot2D(source, style=DEFAULT_2D_STYLE, window=None):
         raise ValueError("No workspace names given to plot")
 
     # Unwrap the window object, if any specified
-    if window != None:
+    if window is not None:
         window = window._getHeldObject()
 
     handles = []
@@ -418,7 +424,7 @@ def plotMD(source, plot_axis=-2, normalization=DEFAULT_MD_NORMALIZATION, error_b
                     "Incorrect axis index given for workspace '%s': %d, should be < %d" % (name, plot_axis, max_axis))
 
     # Unwrap the window object, if any specified
-    if window != None:
+    if window is not None:
         window = window._getHeldObject()
 
     graph = proxies.Graph(threadsafe_call(_qti.app.mantidUI.plotMDList, workspace_names, plot_axis, normalization,
@@ -431,7 +437,6 @@ def fitBrowser():
     """
     Access the fit browser.
     """
-    import mantidqtpython
     return proxies.FitBrowserProxy(_qti.app.mantidUI.fitFunctionBrowser())
 
 
@@ -474,7 +479,7 @@ def plotBin(source, indices, error_bars=False, type=-1, window=None, clearWindow
                                  " number of bins in this workspace - 1 (%d)" % (name, idx, max_bin))
 
     # Unwrap the window object, if any specified
-    if window != None:
+    if window is not None:
         window = window._getHeldObject()
 
     graph = proxies.Graph(threadsafe_call(_qti.app.mantidUI.plot1D,
@@ -501,11 +506,11 @@ def stemPlot(source, index, power=None, startPoint=None, endPoint=None):
         A string representation of the stem plot
     """
     # Turn the optional arguments into the magic numbers that the C++ expects
-    if power == None:
+    if power is None:
         power = 1001
-    if startPoint == None:
+    if startPoint is None:
         startPoint = 0
-    if endPoint == None:
+    if endPoint is None:
         endPoint = -1
 
     if isinstance(source, proxies.QtProxyObject):
@@ -722,6 +727,7 @@ InstrumentWidgetPickTab = mantidqtpython.MantidQt.MantidWidgets.InstrumentWidget
 InstrumentWidgetMaskTab = mantidqtpython.MantidQt.MantidWidgets.InstrumentWidgetMaskTab
 InstrumentWidgetTreeTab = mantidqtpython.MantidQt.MantidWidgets.InstrumentWidgetTreeTab
 
+
 def getInstrumentView(name, tab=InstrumentWidget.RENDER):
     """Create an instrument view window based on the given workspace.
 
@@ -737,6 +743,7 @@ def getInstrumentView(name, tab=InstrumentWidget.RENDER):
         raise ValueError("Workspace '%s' does not exist" % name)
     return new_proxy(proxies.InstrumentView, _qti.app.mantidUI.getInstrumentView, name, tab)
 
+
 def importMatrixWorkspace(name, firstIndex=None, lastIndex=None, showDialog=False, visible=False):
     """Create a MantidMatrix object from the named workspace.
 
@@ -795,7 +802,9 @@ def plotSlice(source, label="", xydim=None, slicepoint=None,
     Optional Keyword Args:
         label :: label for the window title
         xydim :: indexes or names of the dimensions to plot, as an (X,Y) list or tuple. See SliceViewer::setXYDim()
-        slicepoint :: list with the slice point in each dimension.  Must be the same length as the number of dimensions of the workspace. See SliceViewer::setSlicePoint()
+        slicepoint :: list with the slice point in each dimension.
+                      Must be the same length as the number of dimensions of the workspace.
+                      See SliceViewer::setSlicePoint()
         colormin :: value of the minimum color in the scale. See SliceViewer::setColorScaleMin()
         colormax :: value of the maximum color in the scale. See SliceViewer::setColorScaleMax()
         colorscalelog :: value of the maximum color in the scale. See SliceViewer::setColorScaleLog()
@@ -922,10 +931,9 @@ DistrFlag.DistrDefault = mantidqtpython.MantidQt.DistributionDefault
 DistrFlag.DistrTrue = mantidqtpython.MantidQt.DistributionTrue
 DistrFlag.DistrFalse = mantidqtpython.MantidQt.DistributionFalse
 
+
 # -----------------------------------------------------------------------------
 # --------------------------- "Private" functions -----------------------------
-# -----------------------------------------------------------------------------
-
 # -----------------------------------------------------------------------------
 def __doSliceViewer(wsname, label="", xydim=None, slicepoint=None,
                     colormin=None, colormax=None, colorscalelog=False,
@@ -952,14 +960,14 @@ def __doSliceViewer(wsname, label="", xydim=None, slicepoint=None,
 
     sv = threadsafe_call(svw.getSlicer)
     # --- X/Y Dimensions ---
-    if (not xydim is None):
+    if (xydim is not None):
         if len(xydim) != 2:
             raise Exception("You need to specify two values in the 'xydim' parameter")
         else:
             threadsafe_call(sv.setXYDim, xydim[0], xydim[1])
 
     # --- Slice point ---
-    if not slicepoint is None:
+    if slicepoint is not None:
         for d in range(len(slicepoint)):
             try:
                 val = float(slicepoint[d])
@@ -972,18 +980,20 @@ def __doSliceViewer(wsname, label="", xydim=None, slicepoint=None,
     threadsafe_call(sv.setNormalization, normalization)
 
     # --- Color scale ---
-    if (not colormin is None) and (not colormax is None):
+    if (colormin is not None) and (colormax is not None):
         threadsafe_call(sv.setColorScale, colormin, colormax, colorscalelog)
     else:
-        if (not colormin is None): threadsafe_call(sv.setColorScaleMin, colormin)
-        if (not colormax is None): threadsafe_call(sv.setColorScaleMax, colormax)
+        if colormin is not None:
+            threadsafe_call(sv.setColorScaleMin, colormin)
+        if colormax is not None:
+            threadsafe_call(sv.setColorScaleMax, colormax)
     try:
         threadsafe_call(sv.setColorScaleLog, colorscalelog)
     except:
         print("Log color scale not possible.")
 
     # --- XY limits ---
-    if not limits is None:
+    if limits is not None:
         threadsafe_call(sv.setXYLimits, limits[0], limits[1], limits[2], limits[3])
 
     return svw
@@ -994,7 +1004,7 @@ def get_screenshot_dir():
     or NONE if not set """
     expected_env_var = 'MANTID_SCREENSHOT_REPORT'
     dest = os.getenv(expected_env_var)
-    if not dest is None:
+    if dest is not None:
         # Create the report directory if needed
         if not os.path.exists(dest):
             os.mkdir(dest)
@@ -1085,7 +1095,7 @@ def screenshot(widget, filename, description, png_exists=False):
     :param png_exists: if True, then the 'filename' already exists. Don't grab a screenshot, but add to the report.
     """
     dest = get_screenshot_dir()
-    if not dest is None:
+    if dest is not None:
         report = os.path.join(dest, "index.html")
 
         if png_exists:
@@ -1135,25 +1145,26 @@ def screenshot_to_dir(widget, filename, screenshot_dir):
 def __getWorkspaceIndices(source):
     """
         Returns a list of workspace indices from a source.
-        The source can be a list, a tuple, an int or a string.
+        The source can be an iterable, an int or a string.
     """
-    index_list = []
-    if isinstance(source, list) or isinstance(source, tuple):
-        for i in source:
-            nums = __getWorkspaceIndices(i)
-            for j in nums:
-                index_list.append(j)
-    elif isinstance(source, int):
-        index_list.append(source)
-    elif isinstance(source, str):
-        elems = source.split(',')
-        for i in elems:
+    index_list = None
+    if isinstance(source, str):
+        index_list = []
+        items = source.split(",")
+        for item in items:
+            cleaned = item.strip()
             try:
-                index_list.append(int(i))
+                index_list.append(int(cleaned))
             except ValueError:
-                pass
+                continue
+    elif isinstance(source, _collections.Iterable):
+        index_list = list(source)
+    elif isinstance(source, int):
+        index_list = [source]
     else:
-        raise TypeError('Incorrect type passed as index argument "' + str(source) + '"')
+        raise TypeError("Cannot convert source argument to list of int. "
+                        "Expected iterable, int or "
+                        "comma-separated string. Found " + str(source))
     return index_list
 
 
@@ -1234,7 +1245,7 @@ def __checkPlotSliceWorkspaces(ws_names):
 # Creates and shows the detector table
 def createDetectorTable(source):
     try:
-        import mantidqtpython
+        import mantidqtpython # noqa
     except:
         print("Could not find module mantidqtpython. Cannot open the detector table.")
         return
@@ -1246,13 +1257,13 @@ def createDetectorTable(source):
     else:
         return new_proxy(proxies.MDIWindow, _qti.app.mantidUI.createDetectorTable, workspace_names[0])
 
-# -----------------------------------------------------------------------------
+
 def plotSubplots(source, indices, distribution = mantidqtpython.MantidQt.DistributionDefault, error_bars=False, window=None):
     """Open a tiled plot.
 
     This plots one or more spectra, with X as the bin boundaries,
     and Y as the counts in each bin.
-    
+
     If one workspace, each spectrum gets its own tile.
     Otherwise, each workspace gets its own tile.
 
@@ -1267,14 +1278,14 @@ def plotSubplots(source, indices, distribution = mantidqtpython.MantidQt.Distrib
     """
 
     workspace_names = getWorkspaceNames(source)
-   
+
     # Deal with workspace groups that may contain various types:
     # Only want to plot MatrixWorkspaces
     to_plot = []
     for name in workspace_names:
         if isinstance(mantid.api.mtd[name], mantid.api.MatrixWorkspace):
             to_plot.append(name)
-            
+
     __checkPlotWorkspaces(to_plot)
     # check spectrum indices
     index_list = __getWorkspaceIndices(indices)
@@ -1289,11 +1300,11 @@ def plotSubplots(source, indices, distribution = mantidqtpython.MantidQt.Distrib
             if idx > max_spec:
                 raise ValueError("Wrong spectrum index for workspace '%s': %d, which is bigger than the"
                                  " number of spectra in this workspace - 1 (%d)" % (name, idx, max_spec))
-    
+
     # Unwrap the window object, if any specified
-    if window != None:
+    if window is not None:
         window = window._getHeldObject()
-    
+
     graph = proxies.Graph(threadsafe_call(_qti.app.mantidUI.plotSubplots,
                                           to_plot, index_list, distribution, error_bars, window))
     if graph._getHeldObject() == None:
diff --git a/MantidPlot/pymantidplot/proxies.py b/MantidPlot/pymantidplot/proxies.py
index b8fd2d2394ad483ec4c924c4a9407892f2efee0d..98e38bb0176b939d4874d2c874ca35b0b5e830ec 100644
--- a/MantidPlot/pymantidplot/proxies.py
+++ b/MantidPlot/pymantidplot/proxies.py
@@ -1,4 +1,4 @@
-"""
+"""
 Module containing classes that act as proxies to the various MantidPlot gui objects that are
 accessible from python. They listen for the QObject 'destroyed' signal and set the wrapped
 reference to None, thus ensuring that further attempts at access do not cause a crash.
diff --git a/MantidPlot/pymantidplot/pyplot.py b/MantidPlot/pymantidplot/pyplot.py
index 77f7312af3907bdfb7f7d8d7e1e1952f446a53cc..00d2763ca14fab8b58293ae8ab27a45f77ff58a8 100644
--- a/MantidPlot/pymantidplot/pyplot.py
+++ b/MantidPlot/pymantidplot/pyplot.py
@@ -1,4 +1,4 @@
-"""============================================================================
+"""============================================================================
 New Python command line interface for plotting in Mantid (a la matplotlib)
 ============================================================================
 
diff --git a/MantidPlot/test/MantidPlot1DPlotTest.py b/MantidPlot/test/MantidPlot1DPlotTest.py
index d24add8841b003d96c2217a30b2385f5d4c3bb65..226cd8015d1cf0f28e60a2777408f073900b8c4e 100644
--- a/MantidPlot/test/MantidPlot1DPlotTest.py
+++ b/MantidPlot/test/MantidPlot1DPlotTest.py
@@ -3,7 +3,6 @@ Test of basic 1D plotting methods in MantidPlot
 """
 import mantidplottests
 from mantidplottests import *
-import time
 import numpy as np
 from PyQt4 import QtGui, QtCore
 
@@ -20,7 +19,10 @@ X = np.append(X1, X2)
 Y = np.append(Y1, Y2)
 E = np.sqrt(Y)
 
-CreateWorkspace(OutputWorkspace="fake", DataX=list(X), DataY=list(Y), DataE=list(E), NSpec=2, UnitX="TOF", YUnitLabel="Counts",  WorkspaceTitle="Faked data Workspace")
+CreateWorkspace(OutputWorkspace="fake", DataX=list(X), DataY=list(Y), DataE=list(E),
+                NSpec=2, UnitX="TOF", YUnitLabel="Counts",
+                WorkspaceTitle="Faked data Workspace")
+
 
 class MantidPlot1DPlotTest(unittest.TestCase):
 
@@ -30,13 +32,13 @@ class MantidPlot1DPlotTest(unittest.TestCase):
     def tearDown(self):
         """Clean up by closing the created window """
         if hasattr(self, "g") and self.g is not None:
-          self.g.confirmClose(False)
-          self.g.close()
+            self.g.confirmClose(False)
+            self.g.close()
         try:
-          self.t.confirmClose(False)
-          self.t.close()
+            self.t.confirmClose(False)
+            self.t.close()
         except AttributeError:
-          pass
+            pass
         QtCore.QCoreApplication.processEvents()
 
     def test_plotSpectrum_errorBars(self):
@@ -48,12 +50,49 @@ class MantidPlot1DPlotTest(unittest.TestCase):
         g = plotSpectrum(ws, 0, error_bars=True)
         self.g = g
 
-    def test_plotSpectrum_severalSpectra(self):
+    def test_plotSpectrum_single_integer(self):
+        g = plotSpectrum("fake", 1)
+        self._check_graph_contents(g, ["fake-sp-2"])
+        self.g = g
+
+    def test_plotSpectrum_single_str(self):
+        g = plotSpectrum("fake", "1")
+        self._check_graph_contents(g, ["fake-sp-2"])
+        self.g = g
+
+    def test_plotSpectrum_list_of_spectra(self):
         g = plotSpectrum("fake", [0, 1])
+        self._check_graph_contents(g, ["fake-sp-1", "fake-sp-2"])
+        self.g = g
+
+    def test_plotSpectrum_tuple_of_spectra(self):
+        g = plotSpectrum("fake", (0, 1))
+        self._check_graph_contents(g, ["fake-sp-1", "fake-sp-2"])
+        self.g = g
+
+    def test_plotSpectrum_comma_separated_list(self):
+        g = plotSpectrum("fake", "0, 1")
+        self._check_graph_contents(g, ["fake-sp-1", "fake-sp-2"])
+        self.g = g
+
+    def test_plotSpectrum_comma_separated_list_leading_comma(self):
+        g = plotSpectrum("fake", "0, 1,")
+        self._check_graph_contents(g, ["fake-sp-1", "fake-sp-2"])
+        self.g = g
+
+    def test_plotSpectrum_comma_separated_list_trailing_comma(self):
+        g = plotSpectrum("fake", "0, 1,")
+        self._check_graph_contents(g, ["fake-sp-1", "fake-sp-2"])
+        self.g = g
+
+    def test_plotSpectrum_comma_separated_list_empty_value(self):
+        g = plotSpectrum("fake", "0, ,1")
+        self._check_graph_contents(g, ["fake-sp-1", "fake-sp-2"])
         self.g = g
 
     def test_plotSpectrum_range_command(self):
         g = plotSpectrum("fake", range(0, 2))
+        self._check_graph_contents(g, ["fake-sp-1", "fake-sp-2"])
         self.g = g
 
     def test_Customized1DPlot(self):
@@ -82,7 +121,9 @@ class MantidPlot1DPlotTest(unittest.TestCase):
         self.g = g
         l = g.activeLayer() # Plot columns 2, 3 and 4
         for i in range(0, l.numCurves()):
-            l.setCurveLineColor(i, 1 + i) # Curve color is defined as an integer value. Alternatively, the 2nd argument can be of type QtGui.QColor.
+            # Curve color is defined as an integer value. Alternatively, the
+            # 2nd argument can be of type QtGui.QColor.
+            l.setCurveLineColor(i, 1 + i)
             l.setCurveLineWidth(i, 0.5 + 2*i)
 
             l.setCurveLineStyle(1, QtCore.Qt.DotLine)
@@ -112,5 +153,13 @@ class MantidPlot1DPlotTest(unittest.TestCase):
         self.assertTrue(g is not None)
         self.g = g
 
+    # ---------------- Non-test methods ----------------
+    def _check_graph_contents(self, g, curve_titles):
+        layer = g.activeLayer()
+        self.assertEqual(len(curve_titles), layer.numCurves())
+        for i, title in enumerate(curve_titles):
+            self.assertEqual(title, layer.curveTitle(i))
+
+
 # Run the unit tests
 mantidplottests.runTests(MantidPlot1DPlotTest)
diff --git a/MantidPlot/test/MantidPlotInstrumentViewTest.py b/MantidPlot/test/MantidPlotInstrumentViewTest.py
index dfa4c34ed2426073335ceff36b0ee9b1b3b56255..c881127e6603c236395405e3a665cb494e3053e5 100644
--- a/MantidPlot/test/MantidPlotInstrumentViewTest.py
+++ b/MantidPlot/test/MantidPlotInstrumentViewTest.py
@@ -1,4 +1,4 @@
-"""
+"""
 Test the interaction with the instrument view.
 Assertion that things work is difficult so mosts
 test will just that things don't crash.
diff --git a/MantidPlot/test/MantidPlotProxiesTest.py b/MantidPlot/test/MantidPlotProxiesTest.py
index 57842a7d85e486d8135d554d917a3388621e8c8a..1d20f2ef98fc195e08f6d272afe2988abc76d143 100644
--- a/MantidPlot/test/MantidPlotProxiesTest.py
+++ b/MantidPlot/test/MantidPlotProxiesTest.py
@@ -1,4 +1,4 @@
-"""
+"""
 Test the use of proxy objects in MantidPlot that
 prevent crashes when accessing the python object
 after deletion of the object
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/DynamicPDF/DPDFBackgroundRemover.ui b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/DynamicPDF/DPDFBackgroundRemover.ui
index dea4d3f43aa3af3093e4e4a8f0eeb56766a8b15b..74a7bca0989450347d90852703d62663014d76f4 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/DynamicPDF/DPDFBackgroundRemover.ui
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/DynamicPDF/DPDFBackgroundRemover.ui
@@ -143,26 +143,6 @@
          </item>
          <item>
           <layout class="QVBoxLayout" name="verticalLayoutModelDisplayOptions">
-           <item>
-            <widget class="QPushButton" name="pushButtonModelOption2">
-             <property name="toolTip">
-              <string>Add one or more spectra from a workspace</string>
-             </property>
-             <property name="text">
-              <string>some action</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QPushButton" name="pushButtonModelOption1">
-             <property name="toolTip">
-              <string>Remove selected spectra</string>
-             </property>
-             <property name="text">
-              <string>another action</string>
-             </property>
-            </widget>
-           </item>
            <item>
             <spacer name="modelDisplayOptionsSpacer">
              <property name="orientation">
@@ -281,9 +261,6 @@
    <container>1</container>
   </customwidget>
  </customwidgets>
- <tabstops>
-  <tabstop>pushButtonModelOption1</tabstop>
- </tabstops>
  <resources/>
  <connections/>
 </ui>
diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/ApplyPaalmanPings.ui b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/ApplyPaalmanPings.ui
index 756cd3db1dac349e89b5f9b3bad9af00e95728b8..9fe5df2f292c11a83156e4e4ee968cfe77710516 100644
--- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/ApplyPaalmanPings.ui
+++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/ApplyPaalmanPings.ui
@@ -57,6 +57,19 @@
       <string>Options</string>
      </property>
      <layout class="QGridLayout" name="gridLayout">
+      <item row="4" column="0">
+       <widget class="QCheckBox" name="ckShiftCan">
+        <property name="enabled">
+         <bool>false</bool>
+        </property>
+        <property name="text">
+         <string>Shift x-values of container by adding:</string>
+        </property>
+        <property name="checked">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
       <item row="1" column="0">
        <widget class="QCheckBox" name="ckUseCan">
         <property name="text">
@@ -64,33 +77,40 @@
         </property>
        </widget>
       </item>
-      <item row="5" column="0">
+      <item row="4" column="1">
+       <layout class="QHBoxLayout" name="loShiftFactor">
+        <item>
+         <widget class="QDoubleSpinBox" name="spCanShift">
+          <property name="enabled">
+           <bool>false</bool>
+          </property>
+          <property name="decimals">
+           <number>5</number>
+          </property>
+          <property name="minimum">
+           <double>-999.990000000000009</double>
+          </property>
+          <property name="maximum">
+           <double>999.990000000000009</double>
+          </property>
+          <property name="singleStep">
+           <double>0.010000000000000</double>
+          </property>
+          <property name="value">
+           <double>0.000000000000000</double>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item row="6" column="0">
        <widget class="QCheckBox" name="ckUseCorrections">
         <property name="text">
          <string>Use Corrections:</string>
         </property>
        </widget>
       </item>
-      <item row="0" column="1">
-       <widget class="QComboBox" name="cbGeometry">
-        <item>
-         <property name="text">
-          <string>Flat Plate</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string>Cylinder</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string>Annulus</string>
-         </property>
-        </item>
-       </widget>
-      </item>
-      <item row="5" column="1">
+      <item row="6" column="1">
        <widget class="MantidQt::MantidWidgets::DataSelector" name="dsCorrections" native="true">
         <property name="enabled">
          <bool>false</bool>
@@ -119,6 +139,19 @@
         </property>
        </widget>
       </item>
+      <item row="3" column="0">
+       <widget class="QCheckBox" name="ckScaleCan">
+        <property name="enabled">
+         <bool>false</bool>
+        </property>
+        <property name="text">
+         <string>Scale Container by factor:</string>
+        </property>
+        <property name="checked">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
       <item row="1" column="1">
        <widget class="MantidQt::MantidWidgets::DataSelector" name="dsContainer" native="true">
         <property name="enabled">
@@ -150,26 +183,6 @@
         </property>
        </widget>
       </item>
-      <item row="0" column="0">
-       <widget class="QLabel" name="lbGeometry">
-        <property name="text">
-         <string>Geometry:</string>
-        </property>
-       </widget>
-      </item>
-      <item row="3" column="0">
-       <widget class="QCheckBox" name="ckScaleCan">
-        <property name="enabled">
-         <bool>false</bool>
-        </property>
-        <property name="text">
-         <string>Scale Container by factor:</string>
-        </property>
-        <property name="checked">
-         <bool>false</bool>
-        </property>
-       </widget>
-      </item>
       <item row="3" column="1">
        <layout class="QHBoxLayout" name="loScaleFactor">
         <item>
@@ -193,45 +206,45 @@
         </item>
        </layout>
       </item>
-      <item row="4" column="0">
-       <widget class="QCheckBox" name="ckShiftCan">
+      <item row="0" column="1">
+       <widget class="QComboBox" name="cbGeometry">
+        <item>
+         <property name="text">
+          <string>Flat Plate</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Cylinder</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Annulus</string>
+         </property>
+        </item>
+       </widget>
+      </item>
+      <item row="0" column="0">
+       <widget class="QLabel" name="lbGeometry">
+        <property name="text">
+         <string>Geometry:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="5" column="0">
+       <widget class="QCheckBox" name="ckRebinContainer">
         <property name="enabled">
          <bool>false</bool>
         </property>
         <property name="text">
-         <string>Shift x-values of container by adding:</string>
+         <string>Rebin Container to sample</string>
         </property>
         <property name="checked">
-         <bool>false</bool>
+         <bool>true</bool>
         </property>
        </widget>
       </item>
-      <item row="4" column="1">
-       <layout class="QHBoxLayout" name="loShiftFactor">
-        <item>
-         <widget class="QDoubleSpinBox" name="spCanShift">
-          <property name="enabled">
-           <bool>false</bool>
-          </property>
-          <property name="decimals">
-           <number>5</number>
-          </property>
-          <property name="minimum">
-           <double>-999.990000000000009</double>
-          </property>
-          <property name="maximum">
-           <double>999.990000000000009</double>
-          </property>
-          <property name="singleStep">
-           <double>0.010000000000000</double>
-          </property>
-          <property name="value">
-           <double>0.000000000000000</double>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
      </layout>
     </widget>
    </item>
@@ -406,8 +419,8 @@
      <y>111</y>
     </hint>
     <hint type="destinationlabel">
-     <x>61</x>
-     <y>142</y>
+     <x>87</x>
+     <y>196</y>
     </hint>
    </hints>
   </connection>
@@ -422,8 +435,8 @@
      <y>143</y>
     </hint>
     <hint type="destinationlabel">
-     <x>251</x>
-     <y>147</y>
+     <x>712</x>
+     <y>164</y>
     </hint>
    </hints>
   </connection>
@@ -434,12 +447,12 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>133</x>
-     <y>143</y>
+     <x>159</x>
+     <y>196</y>
     </hint>
     <hint type="destinationlabel">
-     <x>251</x>
-     <y>147</y>
+     <x>712</x>
+     <y>199</y>
     </hint>
    </hints>
   </connection>
@@ -454,8 +467,8 @@
      <y>114</y>
     </hint>
     <hint type="destinationlabel">
-     <x>324</x>
-     <y>114</y>
+     <x>784</x>
+     <y>119</y>
     </hint>
    </hints>
   </connection>
@@ -466,12 +479,28 @@
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>119</x>
-     <y>167</y>
+     <x>145</x>
+     <y>256</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>784</x>
+     <y>245</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>ckUseCan</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>ckRebinContainer</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>250</x>
+     <y>122</y>
     </hint>
     <hint type="destinationlabel">
-     <x>324</x>
-     <y>167</y>
+     <x>201</x>
+     <y>219</y>
     </hint>
    </hints>
   </connection>
diff --git a/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp b/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp
index bfe5dd58b9eaf8ed892f0ea0d113683a252bd415..bec547c372411cade113a01ea09000d586d48df3 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp
@@ -34,6 +34,8 @@ ApplyPaalmanPings::ApplyPaalmanPings(QWidget *parent) : CorrectionsTab(parent) {
           SLOT(updateContainer()));
   connect(m_uiForm.ckScaleCan, SIGNAL(toggled(bool)), this,
           SLOT(updateContainer()));
+  connect(m_uiForm.ckRebinContainer, SIGNAL(toggled(bool)), this,
+          SLOT(updateContainer()));
   connect(m_uiForm.ckUseCan, SIGNAL(toggled(bool)), this,
           SLOT(updateContainer()));
   connect(m_uiForm.pbPlot, SIGNAL(clicked()), this, SLOT(plotClicked()));
@@ -122,7 +124,7 @@ void ApplyPaalmanPings::updateContainer() {
     scaleAlg->execute();
 
     const auto sampleValid = m_uiForm.dsSample->isValid();
-    if (sampleValid) {
+    if (sampleValid && m_uiForm.ckRebinContainer->isChecked()) {
       IAlgorithm_sptr rebin =
           AlgorithmManager::Instance().create("RebinToWorkspace");
       rebin->initialize();
@@ -131,7 +133,7 @@ void ApplyPaalmanPings::updateContainer() {
       rebin->setProperty("WorkspaceToMatch", m_sampleWorkspaceName);
       rebin->setProperty("OutputWorkspace", m_containerWorkspaceName);
       rebin->execute();
-    } else {
+    } else if (!sampleValid) {
       // Sample was not valid so do not rebin
       m_uiForm.ppPreview->removeSpectrum("Container");
       return;
@@ -176,17 +178,15 @@ void ApplyPaalmanPings::run() {
         AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(cloneName);
     // Check for same binning across sample and container
     if (!checkWorkspaceBinningMatches(sampleWs, canClone)) {
-      const char *text =
-          "Binning on sample and container does not match."
-          "Would you like to rebin the container to match the sample?";
+      const char *text = "Binning on sample and container does not match."
+                         "Would you like to enable rebinning of the container?";
 
       int result = QMessageBox::question(NULL, tr("Rebin sample?"), tr(text),
                                          QMessageBox::Yes, QMessageBox::No,
                                          QMessageBox::NoButton);
 
       if (result == QMessageBox::Yes) {
-        addRebinStep(QString::fromStdString(canName),
-                     QString::fromStdString(m_sampleWorkspaceName));
+        m_uiForm.ckRebinContainer->setChecked(true);
       } else {
         m_batchAlgoRunner->clearQueue();
         g_log.error("Cannot apply absorption corrections "
@@ -207,6 +207,8 @@ void ApplyPaalmanPings::run() {
       const double canShiftFactor = m_uiForm.spCanShift->value();
       applyCorrAlg->setProperty("canShiftFactor", canShiftFactor);
     }
+    const bool rebinContainer = m_uiForm.ckRebinContainer->isChecked();
+    applyCorrAlg->setProperty("RebinCanToSample", rebinContainer);
   }
 
   if (useCorrections) {
@@ -318,28 +320,6 @@ void ApplyPaalmanPings::run() {
   // updateContainer();
 }
 
-/**
-* Adds a rebin to workspace step to the calculation for when using a sample and
-*container that
-* have different binning.
-*
-* @param toRebin
-* @param toMatch
-*/
-void ApplyPaalmanPings::addRebinStep(QString toRebin, QString toMatch) {
-  API::BatchAlgorithmRunner::AlgorithmRuntimeProps rebinProps;
-  rebinProps["WorkspaceToMatch"] = toMatch.toStdString();
-
-  IAlgorithm_sptr rebinAlg =
-      AlgorithmManager::Instance().create("RebinToWorkspace");
-  rebinAlg->initialize();
-
-  rebinAlg->setProperty("WorkspaceToRebin", toRebin.toStdString());
-  rebinAlg->setProperty("OutputWorkspace", toRebin.toStdString());
-
-  m_batchAlgoRunner->addAlgorithm(rebinAlg, rebinProps);
-}
-
 /**
 * Adds a spline interpolation as a step in the calculation for using legacy
 *correction factor
diff --git a/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp b/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
index 840e0e01b301e99a00055e9770453ef8d2e3f4dd..f38043ab3f308536f0c33f124768253a39b1e021 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
@@ -7,12 +7,10 @@
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/FunctionDomain1D.h"
 #include "MantidAPI/FunctionFactory.h"
-#include "MantidAPI/TextAxis.h"
 #include "MantidAPI/WorkspaceGroup.h"
 #include "MantidGeometry/Instrument.h"
 
 #include <QDoubleValidator>
-#include <QFileInfo>
 #include <QMenu>
 
 #include <qwt_plot.h>
@@ -1108,28 +1106,19 @@ void ConvFit::plotGuess() {
       m_cfInputWS->binIndexOf(m_dblManager->value(m_properties["EndX"]));
   const size_t nData = binIndexHigh - binIndexLow;
 
-  std::vector<double> inputXData(nData);
-  const Mantid::MantidVec &XValues = m_cfInputWS->readX(0);
-  const bool isHistogram = m_cfInputWS->isHistogramData();
+  const auto &xPoints = m_cfInputWS->points(0);
 
-  for (size_t i = 0; i < nData; i++) {
-    if (isHistogram) {
-      inputXData[i] =
-          0.5 * (XValues[binIndexLow + i] + XValues[binIndexLow + i + 1]);
-    } else {
-      inputXData[i] = XValues[binIndexLow + i];
-    }
-  }
+  std::vector<double> dataX(nData);
+  std::copy(&xPoints[binIndexLow], &xPoints[binIndexLow + nData],
+            dataX.begin());
 
-  FunctionDomain1DVector domain(inputXData);
+  FunctionDomain1DVector domain(dataX);
   FunctionValues outputData(domain);
   function->function(domain, outputData);
 
-  QVector<double> dataX, dataY;
-
+  std::vector<double> dataY(nData);
   for (size_t i = 0; i < nData; i++) {
-    dataX.append(inputXData[i]);
-    dataY.append(outputData.getCalculated(i));
+    dataY[i] = outputData.getCalculated(i);
   }
 
   IAlgorithm_sptr createWsAlg =
@@ -1139,8 +1128,8 @@ void ConvFit::plotGuess() {
   createWsAlg->setLogging(false);
   createWsAlg->setProperty("OutputWorkspace", "__GuessAnon");
   createWsAlg->setProperty("NSpec", 1);
-  createWsAlg->setProperty("DataX", dataX.toStdVector());
-  createWsAlg->setProperty("DataY", dataY.toStdVector());
+  createWsAlg->setProperty("DataX", dataX);
+  createWsAlg->setProperty("DataY", dataY);
   createWsAlg->execute();
   MatrixWorkspace_sptr guessWs = createWsAlg->getProperty("OutputWorkspace");
 
diff --git a/MantidQt/CustomInterfaces/src/Indirect/CorrectionsTab.cpp b/MantidQt/CustomInterfaces/src/Indirect/CorrectionsTab.cpp
index 3411cdad54bbc2a23682da519e61b5089292e448..c6657423e088d9e770a3de2f570166af8e194609 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/CorrectionsTab.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/CorrectionsTab.cpp
@@ -1,12 +1,7 @@
 #include "MantidQtCustomInterfaces/Indirect/CorrectionsTab.h"
 #include "MantidAPI/MatrixWorkspace.h"
-#include "MantidAPI/AnalysisDataService.h"
-#include "boost/shared_ptr.hpp"
 
-#include <qwt_plot.h>
-#include <qwt_plot_curve.h>
 #include <QSettings>
-#include <QString>
 
 using namespace Mantid::API;
 
@@ -52,8 +47,8 @@ bool CorrectionsTab::checkWorkspaceBinningMatches(
     MatrixWorkspace_const_sptr left, MatrixWorkspace_const_sptr right) {
   if (left && right) // check the workspaces actually point to something first
   {
-    auto leftX = left->readX(0);
-    auto rightX = right->readX(0);
+    const auto leftX = left->x(0);
+    const auto rightX = right->x(0);
     return std::equal(leftX.begin(), leftX.end(), rightX.begin());
   } else {
     throw std::runtime_error("CorrectionsTab: One of the operands is an "
diff --git a/MantidQt/CustomInterfaces/src/Indirect/ISISCalibration.cpp b/MantidQt/CustomInterfaces/src/Indirect/ISISCalibration.cpp
index cb842494b4026b234f68d30d9aa458c5a2335778..2fb8acde42f54faa971e5ea3534460c34ac1ee5e 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/ISISCalibration.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/ISISCalibration.cpp
@@ -411,7 +411,7 @@ void ISISCalibration::calPlotRaw() {
   MatrixWorkspace_sptr input = boost::dynamic_pointer_cast<MatrixWorkspace>(
       AnalysisDataService::Instance().retrieve(wsname.toStdString()));
 
-  const Mantid::MantidVec &dataX = input->readX(0);
+  const auto &dataX = input->x(0);
   QPair<double, double> range(dataX.front(), dataX.back());
 
   m_uiForm.ppCalibration->clear();
@@ -491,7 +491,7 @@ void ISISCalibration::calPlotEnergy() {
     return;
   }
 
-  const Mantid::MantidVec &dataX = energyWs->readX(0);
+  const auto &dataX = energyWs->x(0);
   QPair<double, double> range(dataX.front(), dataX.back());
 
   auto resBackground = m_uiForm.ppResolution->getRangeSelector("ResBackground");
diff --git a/MantidQt/CustomInterfaces/src/Indirect/ISISDiagnostics.cpp b/MantidQt/CustomInterfaces/src/Indirect/ISISDiagnostics.cpp
index 0cc5864488749ccce0fa3821024586700c2839fe..6295b5956acd0f009ee6696745cf72129ba8b129 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/ISISDiagnostics.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/ISISDiagnostics.cpp
@@ -311,7 +311,7 @@ void ISISDiagnostics::handleNewFile() {
           Mantid::API::AnalysisDataService::Instance().retrieve(
               wsname.toStdString()));
 
-  const Mantid::MantidVec &dataX = input->readX(0);
+  const auto &dataX = input->x(0);
   QPair<double, double> range(dataX.front(), dataX.back());
   int previewSpec =
       static_cast<int>(m_dblManager->value(m_properties["PreviewSpec"])) -
diff --git a/MantidQt/CustomInterfaces/src/Indirect/ISISEnergyTransfer.cpp b/MantidQt/CustomInterfaces/src/Indirect/ISISEnergyTransfer.cpp
index c426cb03763e8a2b4e3e61c6942ad1f9d0b42859..c4894ba1b8492bdbd5f16ca35547e068da1b986c 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/ISISEnergyTransfer.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/ISISEnergyTransfer.cpp
@@ -2,11 +2,9 @@
 
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/WorkspaceGroup.h"
-#include "MantidGeometry/IDTypes.h"
 #include "MantidQtCustomInterfaces/UserInputValidator.h"
 
 #include <QFileInfo>
-#include <QInputDialog>
 
 using namespace Mantid::API;
 using MantidQt::API::BatchAlgorithmRunner;
@@ -168,8 +166,8 @@ bool ISISEnergyTransfer::validate() {
     if (m_uiForm.ckBackgroundRemoval->isChecked()) {
       MatrixWorkspace_sptr tempWs =
           AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(name);
-      const double minBack = tempWs->readX(0)[0];
-      const double maxBack = tempWs->readX(0)[tempWs->blocksize()];
+      const double minBack = tempWs->x(0)[0];
+      const double maxBack = tempWs->x(0)[tempWs->blocksize()];
 
       if (m_uiForm.spBackgroundStart->value() < minBack) {
         uiv.addErrorMessage("The Start of Background Removal is less than the "
@@ -557,8 +555,8 @@ void ISISEnergyTransfer::plotRaw() {
   if (m_uiForm.ckBackgroundRemoval->isChecked()) {
     MatrixWorkspace_sptr tempWs =
         AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(name);
-    const double minBack = tempWs->readX(0)[0];
-    const double maxBack = tempWs->readX(0)[tempWs->blocksize()];
+    const double minBack = tempWs->x(0)[0];
+    const double maxBack = tempWs->x(0)[tempWs->blocksize()];
 
     if (startBack < minBack) {
       emit showMessageBox("The Start of Background Removal is less than the "
diff --git a/MantidQt/CustomInterfaces/src/Indirect/IndirectDataReductionTab.cpp b/MantidQt/CustomInterfaces/src/Indirect/IndirectDataReductionTab.cpp
index 65494a6020f47ac25e2d667467ffbd73287dc5d8..fd6c52936a1a43e0d0f013db81237b5dd2faeb05 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/IndirectDataReductionTab.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/IndirectDataReductionTab.cpp
@@ -216,7 +216,7 @@ std::map<std::string, double> IndirectDataReductionTab::getRangesFromInstrument(
   convUnitsAlg->execute();
   MatrixWorkspace_sptr tofWs = convUnitsAlg->getProperty("OutputWorkspace");
 
-  std::vector<double> tofData = tofWs->readX(0);
+  const auto tofData = tofWs->x(0);
   ranges["peak-start-tof"] = tofData[0];
   ranges["peak-end-tof"] = tofData[2];
   ranges["back-start-tof"] = tofData[3];
diff --git a/MantidQt/CustomInterfaces/src/Indirect/IndirectSymmetrise.cpp b/MantidQt/CustomInterfaces/src/Indirect/IndirectSymmetrise.cpp
index e229ed001e99b840f8b2efae0dcd6e11a29f95ab..c72b350cfb7c225c6cc149fbd857f409c0d3e059 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/IndirectSymmetrise.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/IndirectSymmetrise.cpp
@@ -3,9 +3,6 @@
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidKernel/Logger.h"
-#include "MantidQtCustomInterfaces/UserInputValidator.h"
-
-#include <QFileInfo>
 
 namespace {
 Mantid::Kernel::Logger g_log("IndirectSymmetrise");
@@ -423,8 +420,8 @@ void IndirectSymmetrise::previewAlgDone(bool error) {
   int positiveIndex = propsTable->getColumn("PositiveXMinIndex")->cell<int>(0);
 
   // Get the Y values for each XCut and the difference between them
-  double negativeY = sampleWS->dataY(0)[negativeIndex];
-  double positiveY = sampleWS->dataY(0)[positiveIndex];
+  double negativeY = sampleWS->y(0)[negativeIndex];
+  double positiveY = sampleWS->y(0)[positiveIndex];
   double deltaY = fabs(negativeY - positiveY);
 
   // Show values in property tree
diff --git a/MantidQt/CustomInterfaces/src/Indirect/Iqt.cpp b/MantidQt/CustomInterfaces/src/Indirect/Iqt.cpp
index 0380970ee5e09d76319dbcc46676aa9ec420e373..db86c0354449df89cf1cb8dff3c39b8744fd0c00 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/Iqt.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/Iqt.cpp
@@ -5,12 +5,7 @@
 #include "MantidGeometry/Instrument.h"
 #include "MantidQtMantidWidgets/RangeSelector.h"
 
-#include <QFileInfo>
-
 #include <qwt_plot.h>
-#include <boost/lexical_cast.hpp>
-
-#include <cmath>
 
 namespace {
 Mantid::Kernel::Logger g_log("Iqt");
@@ -154,7 +149,7 @@ void Iqt::PlotTiled() {
 
   // Find x value where y > 1 in 0th spectra
   const auto tiledPlotWsName = outWs->getName() + "_tiled";
-  const auto y_data = outWs->dataY(0);
+  const auto y_data = outWs->y(0);
   const auto y_data_length = y_data.size();
   auto crop_index = y_data.size();
   for (size_t i = 0; i < y_data_length; i++) {
@@ -163,7 +158,7 @@ void Iqt::PlotTiled() {
       break;
     }
   }
-  const auto crop_value = outWs->dataX(0)[crop_index];
+  const auto crop_value = outWs->x(0)[crop_index];
 
   // Clone workspace before cropping to keep in ADS
   IAlgorithm_sptr clone = AlgorithmManager::Instance().create("CloneWorkspace");
diff --git a/MantidQt/CustomInterfaces/src/Indirect/IqtFit.cpp b/MantidQt/CustomInterfaces/src/Indirect/IqtFit.cpp
index 89bfc97a61aaa2cc7bc255033eff8f02f20ccd21..ebb15944ddbfeb597eb52297081d508b2c8efb05 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/IqtFit.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/IqtFit.cpp
@@ -9,9 +9,7 @@
 #include "MantidAPI/FunctionFactory.h"
 #include "MantidAPI/WorkspaceGroup.h"
 
-#include <QFileInfo>
 #include <QMenu>
-#include <math.h>
 
 #include <qwt_plot.h>
 #include <qwt_plot_curve.h>
@@ -616,8 +614,8 @@ void IqtFit::setDefaultParameters(const QString &name) {
   double background = m_dblManager->value(m_properties["BackgroundA0"]);
   // intensity is always 1-background
   m_dblManager->setValue(m_properties[name + ".Intensity"], 1.0 - background);
-  auto x = m_iqtFInputWS->readX(0);
-  auto y = m_iqtFInputWS->readY(0);
+  auto x = m_iqtFInputWS->x(0);
+  auto y = m_iqtFInputWS->y(0);
   double tau = 0;
 
   if (x.size() > 4) {
@@ -944,31 +942,20 @@ void IqtFit::plotGuess(QtProperty *) {
       m_iqtFRangeManager->value(m_properties["EndX"]));
   const size_t nData = binIndxHigh - binIndxLow;
 
-  std::vector<double> inputXData(nData);
+  const auto &xPoints = m_iqtFInputWS->points(0);
 
-  const Mantid::MantidVec &XValues = m_iqtFInputWS->readX(0);
+  std::vector<double> dataX(nData);
+  std::copy(&xPoints[binIndxLow], &xPoints[binIndxLow + nData], dataX.begin());
 
-  const bool isHistogram = m_iqtFInputWS->isHistogramData();
-
-  for (size_t i = 0; i < nData; i++) {
-    if (isHistogram)
-      inputXData[i] =
-          0.5 * (XValues[binIndxLow + i] + XValues[binIndxLow + i + 1]);
-    else
-      inputXData[i] = XValues[binIndxLow + i];
-  }
-
-  FunctionDomain1DVector domain(inputXData);
+  FunctionDomain1DVector domain(dataX);
   FunctionValues outputData(domain);
   function->function(domain, outputData);
 
-  QVector<double> dataX;
-  QVector<double> dataY;
-
+  std::vector<double> dataY(nData);
   for (size_t i = 0; i < nData; i++) {
-    dataX.append(inputXData[i]);
-    dataY.append(outputData.getCalculated(i));
+    dataY[i] = outputData.getCalculated(i);
   }
+
   IAlgorithm_sptr createWsAlg =
       AlgorithmManager::Instance().create("CreateWorkspace");
   createWsAlg->initialize();
@@ -976,8 +963,8 @@ void IqtFit::plotGuess(QtProperty *) {
   createWsAlg->setLogging(false);
   createWsAlg->setProperty("OutputWorkspace", "__GuessAnon");
   createWsAlg->setProperty("NSpec", 1);
-  createWsAlg->setProperty("DataX", dataX.toStdVector());
-  createWsAlg->setProperty("DataY", dataY.toStdVector());
+  createWsAlg->setProperty("DataX", dataX);
+  createWsAlg->setProperty("DataY", dataY);
   createWsAlg->execute();
   MatrixWorkspace_sptr guessWs = createWsAlg->getProperty("OutputWorkspace");
 
diff --git a/MantidQt/CustomInterfaces/src/Indirect/ResNorm.cpp b/MantidQt/CustomInterfaces/src/Indirect/ResNorm.cpp
index a73ec35c9a5e2def5b34ef1151b5365004505ccc..d91c198cdb71cf99e2fb592c741a00b0f6d6b5f5 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/ResNorm.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/ResNorm.cpp
@@ -289,12 +289,12 @@ void ResNorm::previewSpecChanged(int value) {
               fitWsName);
 
       MatrixWorkspace_sptr fit = WorkspaceFactory::Instance().create(fitWs, 1);
-      fit->setX(0, fitWs->refX(1));
-      fit->dataY(0) = fitWs->readY(1);
-      fit->dataE(0) = fitWs->readE(1);
+      fit->setSharedX(0, fit->sharedX(1));
+      fit->setSharedY(0, fit->sharedY(1));
+      fit->setSharedE(0, fit->sharedE(1));
 
       for (size_t i = 0; i < fit->blocksize(); i++)
-        fit->dataY(0)[i] /= scaleFactors->cell<double>(m_previewSpec);
+        fit->mutableY(0)[i] /= scaleFactors->cell<double>(m_previewSpec);
 
       m_uiForm.ppPlot->addSpectrum("Fit", fit, 0, Qt::red);
     }
diff --git a/MantidQt/CustomInterfaces/src/SANSAddFiles.cpp b/MantidQt/CustomInterfaces/src/SANSAddFiles.cpp
index d8c0a534b33ce2a535446daa12dc9bdb2d7f9aff..59178f02cf70646b7c995153d515b9016914406a 100644
--- a/MantidQt/CustomInterfaces/src/SANSAddFiles.cpp
+++ b/MantidQt/CustomInterfaces/src/SANSAddFiles.cpp
@@ -256,7 +256,7 @@ void SANSAddFiles::runPythonAddFiles() {
   add2Runs2Add();
 
   QString code_torun = "import SANSadd2\n";
-  code_torun += "print SANSadd2.add_runs((";
+  code_torun += "print(SANSadd2.add_runs((";
   // there are multiple file list inputs that can be filled in loop through them
   for (int i = 0; i < m_SANSForm->toAdd_List->count(); ++i) {
     QString filename =
@@ -314,7 +314,7 @@ void SANSAddFiles::runPythonAddFiles() {
     break;
   }
 
-  code_torun += ")\n";
+  code_torun += "))\n";
 
   g_log.debug() << "Executing Python: \n" << code_torun.toStdString() << '\n';
 
diff --git a/MantidQt/CustomInterfaces/src/SANSDiagnostics.cpp b/MantidQt/CustomInterfaces/src/SANSDiagnostics.cpp
index 8a77a08fc608db3f6002ff1aaa378927852dae99..33514ff1666928b77d257dfba7d204834363051e 100644
--- a/MantidQt/CustomInterfaces/src/SANSDiagnostics.cpp
+++ b/MantidQt/CustomInterfaces/src/SANSDiagnostics.cpp
@@ -1261,7 +1261,7 @@ bool SANSDiagnostics::runsumRowColumn(const QString ipwsName,
   code += hvMax;
   code += ")\n";
   code += "except:\n";
-  code += "  print 'Failure'";
+  code += "  print('Failure')";
 
   QString ret = runPythonCode(code.trimmed());
   if (!ret.isEmpty()) {
@@ -1310,7 +1310,7 @@ bool SANSDiagnostics::runsumSpectra(const QString &ipwsName,
   code += wsEndIndex;
   code += ")\n";
   code += "except:\n";
-  code += "  print 'Failure'";
+  code += "  print('Failure')";
 
   QString ret = runPythonCode(code.trimmed());
   if (!ret.isEmpty()) {
@@ -1362,7 +1362,7 @@ bool SANSDiagnostics::runLoadAlgorithm(const QString &fileName,
   }
   load += ")\n";
   load += "except:\n";
-  load += "  print 'Failure'";
+  load += "  print('Failure')";
 
   QString ret = runPythonCode(load.trimmed());
   if (!ret.isEmpty()) {
diff --git a/MantidQt/CustomInterfaces/src/SANSEventSlicing.cpp b/MantidQt/CustomInterfaces/src/SANSEventSlicing.cpp
index 6e7d8f5d42e7afefa9cc1e509e1d4c972552f7cf..a7cda3c46d8b5765dc1278862936c843bbd2e3d0 100644
--- a/MantidQt/CustomInterfaces/src/SANSEventSlicing.cpp
+++ b/MantidQt/CustomInterfaces/src/SANSEventSlicing.cpp
@@ -75,9 +75,9 @@ SANSEventSlicing::getFullChargeAndTime(const QString &name_ws) {
          << "ws = mtd['" << name_ws << "']\n"
          << "try:\n"
          << "  charge, t_passed = su.getChargeAndTime(ws)\n"
-         << "  print '%.2f, %.2f' %(charge, t_passed)\n"
+         << "  print('%.2f, %.2f' %(charge, t_passed))\n"
          << "except :\n"
-         << "  print 'EXCEPTION:',sys.exc_info()[1]\n";
+         << "  print('EXCEPTION:',sys.exc_info()[1])\n";
 
   QString result = runPythonCode(code).simplified();
 
@@ -126,9 +126,9 @@ QString SANSEventSlicing::createSliceEventCode(const QString &name_ws,
          << "  mon = mtd['" << name_ws << "_monitors']\n"
          << "  hist, times = su.slice2histogram(ws"
          << ", " << start << ", " << stop << ", mon)\n"
-         << "  print '%.2f, %.2f' %(times[3], times[2])\n"
+         << "  print('%.2f, %.2f' %(times[3], times[2]))\n"
          << "except:\n"
-         << "  print 'EXCEPTION:',sys.exc_info()[1]";
+         << "  print('EXCEPTION:',sys.exc_info()[1])";
 
   return code;
 }
diff --git a/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp b/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
index bd5b42334ae2b8026d91960300b95b8ca26a878e..85d0b94257e64b096dfe9ad80dbffaf45b1cc2ee 100644
--- a/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
+++ b/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
@@ -441,8 +441,8 @@ void SANSRunWindow::makeValidator(QLabel *const newValid, QWidget *control,
 void SANSRunWindow::initLocalPython() {
   // Import the SANS module and set the correct instrument
   QString result = runPythonCode(
-      "try:\n\timport isis_reducer\nexcept (ImportError,SyntaxError), "
-      "details:\tprint 'Error importing isis_reducer: ' + str(details)\n");
+      "try:\n\timport isis_reducer\nexcept (ImportError,SyntaxError) as "
+      "details:\tprint('Error importing isis_reducer: ' + str(details))\n");
   if (result.trimmed().isEmpty()) {
     m_have_reducemodule = true;
   } else {
@@ -795,7 +795,7 @@ QString SANSRunWindow::runReduceScriptFunction(const QString &pycode) {
   g_log.debug() << "Executing Python: " << pycode.toStdString() << '\n';
 
   const static QString PYTHON_SEP("C++runReduceScriptFunctionC++");
-  QString code_torun = pycode + ";print '" + PYTHON_SEP + "p'";
+  QString code_torun = pycode + ";print('" + PYTHON_SEP + "')";
   QString pythonOut = runPythonCode(code_torun).trimmed();
 
   QStringList allOutput = pythonOut.split(PYTHON_SEP);
@@ -846,9 +846,9 @@ bool SANSRunWindow::loadUserFile() {
   runReduceScriptFunction(pyCode);
 
   QString errors =
-      runReduceScriptFunction("print "
+      runReduceScriptFunction("print("
                               "i.ReductionSingleton().user_settings.execute(i."
-                              "ReductionSingleton())").trimmed();
+                              "ReductionSingleton()))").trimmed();
   // create a string list with a string for each line
   const QStringList allOutput = errors.split("\n");
   errors.clear();
@@ -871,29 +871,29 @@ bool SANSRunWindow::loadUserFile() {
   const double unit_conv(1000.);
   // Radius
   double dbl_param =
-      runReduceScriptFunction("print i.ReductionSingleton().mask.min_radius")
+      runReduceScriptFunction("print(i.ReductionSingleton().mask.min_radius)")
           .toDouble();
   m_uiForm.rad_min->setText(QString::number(dbl_param * unit_conv));
   dbl_param = runReduceScriptFunction(
-                  "print i.ReductionSingleton().mask.max_radius").toDouble();
+                  "print(i.ReductionSingleton().mask.max_radius)").toDouble();
   m_uiForm.rad_max->setText(QString::number(dbl_param * unit_conv));
   // EventsTime
   m_uiForm.l_events_binning->setText(
       getSettingWithDefault("events.binning", "").trimmed());
   // Wavelength
   m_uiForm.wav_min->setText(runReduceScriptFunction(
-      "print i.ReductionSingleton().to_wavelen.wav_low"));
+      "print(i.ReductionSingleton().to_wavelen.wav_low)"));
   m_uiForm.wav_max->setText(
       runReduceScriptFunction(
-          "print i.ReductionSingleton().to_wavelen.wav_high").trimmed());
+          "print(i.ReductionSingleton().to_wavelen.wav_high)").trimmed());
   const QString wav_step =
       runReduceScriptFunction(
-          "print i.ReductionSingleton().to_wavelen.wav_step").trimmed();
+          "print(i.ReductionSingleton().to_wavelen.wav_step)").trimmed();
   setLimitStepParameter("wavelength", wav_step, m_uiForm.wav_dw,
                         m_uiForm.wav_dw_opt);
   // Q
   QString text =
-      runReduceScriptFunction("print i.ReductionSingleton().to_Q.binning");
+      runReduceScriptFunction("print(i.ReductionSingleton().to_Q.binning)");
   QStringList values = text.split(",");
   if (values.count() == 3) {
     m_uiForm.q_min->setText(values[0].trimmed());
@@ -907,9 +907,9 @@ bool SANSRunWindow::loadUserFile() {
 
   // Qxy
   m_uiForm.qy_max->setText(
-      runReduceScriptFunction("print i.ReductionSingleton().QXY2"));
+      runReduceScriptFunction("print(i.ReductionSingleton().QXY2)"));
   setLimitStepParameter(
-      "Qxy", runReduceScriptFunction("print i.ReductionSingleton().DQXY"),
+      "Qxy", runReduceScriptFunction("print(i.ReductionSingleton().DQXY)"),
       m_uiForm.qy_dqy, m_uiForm.qy_dqy_opt);
 
   // The tramission line of the Limits section (read settings for sample and
@@ -918,22 +918,22 @@ bool SANSRunWindow::loadUserFile() {
 
   // The front rescale/shift section
   m_uiForm.frontDetRescale->setText(
-      runReduceScriptFunction("print "
+      runReduceScriptFunction("print("
                               "i.ReductionSingleton().instrument.getDetector('"
-                              "FRONT').rescaleAndShift.scale").trimmed());
+                              "FRONT').rescaleAndShift.scale)").trimmed());
   m_uiForm.frontDetShift->setText(
-      runReduceScriptFunction("print "
+      runReduceScriptFunction("print("
                               "i.ReductionSingleton().instrument.getDetector('"
-                              "FRONT').rescaleAndShift.shift").trimmed());
+                              "FRONT').rescaleAndShift.shift)").trimmed());
 
   QString fitScale =
-      runReduceScriptFunction("print "
+      runReduceScriptFunction("print("
                               "i.ReductionSingleton().instrument.getDetector('"
-                              "FRONT').rescaleAndShift.fitScale").trimmed();
+                              "FRONT').rescaleAndShift.fitScale)").trimmed();
   QString fitShift =
-      runReduceScriptFunction("print "
+      runReduceScriptFunction("print("
                               "i.ReductionSingleton().instrument.getDetector('"
-                              "FRONT').rescaleAndShift.fitShift").trimmed();
+                              "FRONT').rescaleAndShift.fitShift)").trimmed();
 
   if (fitScale == "True")
     m_uiForm.frontDetRescaleCB->setChecked(true);
@@ -946,39 +946,39 @@ bool SANSRunWindow::loadUserFile() {
     m_uiForm.frontDetShiftCB->setChecked(false);
 
   QString qRangeUserSelected =
-      runReduceScriptFunction("print "
+      runReduceScriptFunction("print("
                               "i.ReductionSingleton().instrument.getDetector('"
-                              "FRONT').rescaleAndShift.qRangeUserSelected")
+                              "FRONT').rescaleAndShift.qRangeUserSelected)")
           .trimmed();
   if (qRangeUserSelected == "True") {
     m_uiForm.frontDetQrangeOnOff->setChecked(true);
     m_uiForm.frontDetQmin->setText(
-        runReduceScriptFunction("print "
+        runReduceScriptFunction("print("
                                 "i.ReductionSingleton().instrument.getDetector("
-                                "'FRONT').rescaleAndShift.qMin").trimmed());
+                                "'FRONT').rescaleAndShift.qMin)").trimmed());
     m_uiForm.frontDetQmax->setText(
-        runReduceScriptFunction("print "
+        runReduceScriptFunction("print("
                                 "i.ReductionSingleton().instrument.getDetector("
-                                "'FRONT').rescaleAndShift.qMax").trimmed());
+                                "'FRONT').rescaleAndShift.qMax)").trimmed());
   } else
     m_uiForm.frontDetQrangeOnOff->setChecked(false);
 
   // Monitor spectra
   m_uiForm.monitor_spec->setText(
       runReduceScriptFunction(
-          "print i.ReductionSingleton().instrument.get_incident_mon()")
+          "print(i.ReductionSingleton().instrument.get_incident_mon())")
           .trimmed());
   m_uiForm.trans_monitor->setText(
       runReduceScriptFunction(
-          "print i.ReductionSingleton().instrument.incid_mon_4_trans_calc")
+          "print(i.ReductionSingleton().instrument.incid_mon_4_trans_calc)")
           .trimmed());
   m_uiForm.monitor_interp->setChecked(
       runReduceScriptFunction(
-          "print i.ReductionSingleton().instrument.is_interpolating_norm()")
+          "print(i.ReductionSingleton().instrument.is_interpolating_norm())")
           .trimmed() == "True");
   m_uiForm.trans_interp->setChecked(
       runReduceScriptFunction(
-          "print i.ReductionSingleton().transmission_calculator.interpolate")
+          "print(i.ReductionSingleton().transmission_calculator.interpolate)")
           .trimmed() == "True");
 
   // Transmission settings
@@ -986,12 +986,12 @@ bool SANSRunWindow::loadUserFile() {
 
   // Direct efficiency correction
   m_uiForm.direct_file->setText(runReduceScriptFunction(
-      "print i.ReductionSingleton().instrument.detector_file('rear')"));
+      "print(i.ReductionSingleton().instrument.detector_file('rear'))"));
   m_uiForm.front_direct_file->setText(runReduceScriptFunction(
-      "print i.ReductionSingleton().instrument.detector_file('front')"));
+      "print(i.ReductionSingleton().instrument.detector_file('front'))"));
 
   QString file = runReduceScriptFunction(
-      "print i.ReductionSingleton().prep_normalize.getPixelCorrFile('REAR')");
+      "print(i.ReductionSingleton().prep_normalize.getPixelCorrFile('REAR'))");
   file = file.trimmed();
   // Check if the file name is set to Python's None object and then adjust the
   // controls if there is an empty entry
@@ -1001,7 +1001,7 @@ bool SANSRunWindow::loadUserFile() {
   m_uiForm.floodRearFile->setEnabled(
       m_uiForm.enableRearFlood_ck->checkState() == Qt::Checked);
   file = runReduceScriptFunction(
-      "print i.ReductionSingleton().prep_normalize.getPixelCorrFile('FRONT')");
+      "print(i.ReductionSingleton().prep_normalize.getPixelCorrFile('FRONT'))");
   file = file.trimmed();
   m_uiForm.floodFrontFile->setFileTextWithSearch(file == "None" ? "" : file);
   m_uiForm.enableFrontFlood_ck->setChecked(!m_uiForm.floodFrontFile->isEmpty());
@@ -1011,13 +1011,13 @@ bool SANSRunWindow::loadUserFile() {
   // Scale factor
   dbl_param =
       runReduceScriptFunction(
-          "print i.ReductionSingleton()._corr_and_scale.rescale").toDouble();
+          "print(i.ReductionSingleton()._corr_and_scale.rescale)").toDouble();
   m_uiForm.scale_factor->setText(QString::number(dbl_param / 100.));
 
   // Sample offset if one has been specified
   dbl_param =
       runReduceScriptFunction(
-          "print i.ReductionSingleton().instrument.SAMPLE_Z_CORR").toDouble();
+          "print(i.ReductionSingleton().instrument.SAMPLE_Z_CORR)").toDouble();
   m_uiForm.smpl_offset->setText(QString::number(dbl_param * unit_conv));
 
   // Centre coordinates
@@ -1026,36 +1026,36 @@ bool SANSRunWindow::loadUserFile() {
   // Set the beam finder specific settings
   setBeamFinderDetails();
   // get the scale factor1 for the beam centre to scale it correctly
-  dbl_param =
-      runReduceScriptFunction(
-          "print i.ReductionSingleton().get_beam_center('rear')[0]").toDouble();
+  dbl_param = runReduceScriptFunction(
+                  "print(i.ReductionSingleton().get_beam_center('rear')[0])")
+                  .toDouble();
   double dbl_paramsf =
       runReduceScriptFunction(
-          "print i.ReductionSingleton().get_beam_center_scale_factor1()")
+          "print(i.ReductionSingleton().get_beam_center_scale_factor1())")
           .toDouble();
   m_uiForm.rear_beam_x->setText(QString::number(dbl_param * dbl_paramsf));
   // get scale factor2 for the beam centre to scale it correctly
   dbl_paramsf =
       runReduceScriptFunction(
-          "print i.ReductionSingleton().get_beam_center_scale_factor2()")
+          "print(i.ReductionSingleton().get_beam_center_scale_factor2())")
           .toDouble();
-  dbl_param =
-      runReduceScriptFunction(
-          "print i.ReductionSingleton().get_beam_center('rear')[1]").toDouble();
+  dbl_param = runReduceScriptFunction(
+                  "print(i.ReductionSingleton().get_beam_center('rear')[1])")
+                  .toDouble();
   m_uiForm.rear_beam_y->setText(QString::number(dbl_param * dbl_paramsf));
   // front
   dbl_param = runReduceScriptFunction(
-                  "print i.ReductionSingleton().get_beam_center('front')[0]")
+                  "print(i.ReductionSingleton().get_beam_center('front')[0])")
                   .toDouble();
   m_uiForm.front_beam_x->setText(QString::number(dbl_param * 1000.0));
   dbl_param = runReduceScriptFunction(
-                  "print i.ReductionSingleton().get_beam_center('front')[1]")
+                  "print(i.ReductionSingleton().get_beam_center('front')[1])")
                   .toDouble();
   m_uiForm.front_beam_y->setText(QString::number(dbl_param * 1000.0));
   // Gravity switch
   QString param =
-      runReduceScriptFunction("print i.ReductionSingleton().to_Q.get_gravity()")
-          .trimmed();
+      runReduceScriptFunction(
+          "print(i.ReductionSingleton().to_Q.get_gravity())").trimmed();
   if (param == "True") {
     m_uiForm.gravity_check->setChecked(true);
   } else {
@@ -1065,14 +1065,14 @@ bool SANSRunWindow::loadUserFile() {
   // Read the extra length for the gravity correction
   const double extraLengthParam =
       runReduceScriptFunction(
-          "print i.ReductionSingleton().to_Q.get_extra_length()").toDouble();
+          "print(i.ReductionSingleton().to_Q.get_extra_length())").toDouble();
   m_uiForm.gravity_extra_length_line_edit->setText(
       QString::number(extraLengthParam));
 
   ////Detector bank: support REAR, FRONT, HAB, BOTH, MERGED, MERGE options
   QString detName =
       runReduceScriptFunction(
-          "print i.ReductionSingleton().instrument.det_selection").trimmed();
+          "print(i.ReductionSingleton().instrument.det_selection)").trimmed();
 
   if (detName == "REAR" || detName == "MAIN") {
     m_uiForm.detbank_sel->setCurrentIndex(0);
@@ -1086,9 +1086,9 @@ bool SANSRunWindow::loadUserFile() {
 
   // Phi values
   m_uiForm.phi_min->setText(
-      runReduceScriptFunction("print i.ReductionSingleton().mask.phi_min"));
+      runReduceScriptFunction("print(i.ReductionSingleton().mask.phi_min)"));
   m_uiForm.phi_max->setText(
-      runReduceScriptFunction("print i.ReductionSingleton().mask.phi_max"));
+      runReduceScriptFunction("print(i.ReductionSingleton().mask.phi_max)"));
 
   // Masking table
   updateMaskTable();
@@ -1100,7 +1100,7 @@ bool SANSRunWindow::loadUserFile() {
   initializeBackgroundCorrection();
   retrieveBackgroundCorrection();
 
-  if (runReduceScriptFunction("print i.ReductionSingleton().mask.phi_mirror")
+  if (runReduceScriptFunction("print(i.ReductionSingleton().mask.phi_mirror)")
           .trimmed() == "True") {
     m_uiForm.mirror_phi->setChecked(true);
   } else {
@@ -1242,40 +1242,40 @@ void SANSRunWindow::updateMaskTable() {
 
   // Now add information from the mask file
   // Spectrum mask, "Rear" det
-  QString mask_string =
-      runReduceScriptFunction("print i.ReductionSingleton().mask.spec_mask_r");
+  QString mask_string = runReduceScriptFunction(
+      "print (i.ReductionSingleton().mask.spec_mask_r)");
   addSpectrumMasksToTable(mask_string, reardet_name);
   //"Front" det
-  mask_string =
-      runReduceScriptFunction("print i.ReductionSingleton().mask.spec_mask_f");
+  mask_string = runReduceScriptFunction(
+      "print (i.ReductionSingleton().mask.spec_mask_f)");
   addSpectrumMasksToTable(mask_string, frontdet_name);
 
   // Time masks
   mask_string =
-      runReduceScriptFunction("print i.ReductionSingleton().mask.time_mask");
+      runReduceScriptFunction("print (i.ReductionSingleton().mask.time_mask)");
   addTimeMasksToTable(mask_string, "-");
   // Rear detector
   mask_string =
-      runReduceScriptFunction("print i.ReductionSingleton().mask.time_mask_r");
+      runReduceScriptFunction("print(i.ReductionSingleton().mask.time_mask_r)");
   addTimeMasksToTable(mask_string, reardet_name);
   // Front detectors
   mask_string =
-      runReduceScriptFunction("print i.ReductionSingleton().mask.time_mask_f");
+      runReduceScriptFunction("print(i.ReductionSingleton().mask.time_mask_f)");
   addTimeMasksToTable(mask_string, frontdet_name);
   // Rear detectors for SANS2D if monitor 4 in place (arm shadow detector)
   mask_string =
-      runReduceScriptFunction("print i.ReductionSingleton().mask.time_mask_f");
+      runReduceScriptFunction("print(i.ReductionSingleton().mask.time_mask_f)");
   addTimeMasksToTable(mask_string, frontdet_name);
 
   if (getInstrumentClass() == "SANS2D()") {
     QString arm_width =
-        runReduceScriptFunction("print i.ReductionSingleton().mask.arm_width");
+        runReduceScriptFunction("print(i.ReductionSingleton().mask.arm_width)");
     QString arm_angle =
-        runReduceScriptFunction("print i.ReductionSingleton().mask.arm_angle");
+        runReduceScriptFunction("print(i.ReductionSingleton().mask.arm_angle)");
     QString arm_x =
-        runReduceScriptFunction("print i.ReductionSingleton().mask.arm_x");
+        runReduceScriptFunction("print(i.ReductionSingleton().mask.arm_x)");
     QString arm_y =
-        runReduceScriptFunction("print i.ReductionSingleton().mask.arm_y");
+        runReduceScriptFunction("print(i.ReductionSingleton().mask.arm_y)");
     if (arm_width != "None" && arm_angle != "None") {
       int row = m_uiForm.mask_table->rowCount();
       m_uiForm.mask_table->insertRow(row);
@@ -1790,7 +1790,7 @@ void SANSRunWindow::setGeometryDetails() {
     }
 
     QString marked_dets =
-        runReduceScriptFunction("print i.GetMismatchedDetList(),").trimmed();
+        runReduceScriptFunction("print(i.GetMismatchedDetList()),").trimmed();
     trimPyMarkers(marked_dets);
     if (!marked_dets.isEmpty()) {
       QStringList detnames = marked_dets.split(",");
@@ -1836,8 +1836,8 @@ void SANSRunWindow::setSANS2DGeometry(
 
   // get the tuple of log values and convert to a list of
   QString code_to_run =
-      QString("print ','.join([str(a) for a in "
-              "i.ReductionSingleton().instrument.getDetValues('%1')])")
+      QString("print(','.join([str(a) for a in "
+              "i.ReductionSingleton().instrument.getDetValues('%1')]))")
           .arg(QString::fromStdString(workspace->getName()));
 
   QStringList logvalues = runReduceScriptFunction(code_to_run).split(",");
@@ -2170,8 +2170,8 @@ bool SANSRunWindow::handleLoadButtonClick() {
 */
 void SANSRunWindow::readNumberOfEntries(const QString &RunStep,
                                         API::MWRunFiles *const output) {
-  QString periods = runReduceScriptFunction("print i.ReductionSingleton()." +
-                                            RunStep + ".periods_in_file");
+  QString periods = runReduceScriptFunction("print(i.ReductionSingleton()." +
+                                            RunStep + ".periods_in_file)");
   output->setNumberOfEntries(periods.toInt());
 }
 /** Construct the python code to perform the analysis using the
@@ -2477,7 +2477,7 @@ void SANSRunWindow::handleReduceButtonClick(const QString &typeStr) {
     py_code += reduceSingleRun();
     // output the name of the output workspace, this is returned up by the
     // runPythonCode() call below
-    py_code += "\nprint '" + PYTHON_SEP + "'+reduced+'" + PYTHON_SEP + "'";
+    py_code += "\nprint('" + PYTHON_SEP + "'+reduced+'" + PYTHON_SEP + "')";
   } else {
     // Have we got anything to reduce?
     if (m_uiForm.batch_table->rowCount() == 0) {
@@ -2554,24 +2554,24 @@ void SANSRunWindow::handleReduceButtonClick(const QString &typeStr) {
   if (runMode == SingleMode) {
     // update front rescale and fit values
     scale =
-        runReduceScriptFunction("print "
+        runReduceScriptFunction("print("
                                 "i.ReductionSingleton().instrument.getDetector("
-                                "'FRONT').rescaleAndShift.scale")
+                                "'FRONT').rescaleAndShift.scale)")
             .trimmed()
             .toDouble();
 
     shift =
-        runReduceScriptFunction("print "
+        runReduceScriptFunction("print("
                                 "i.ReductionSingleton().instrument.getDetector("
-                                "'FRONT').rescaleAndShift.shift")
+                                "'FRONT').rescaleAndShift.shift)")
             .trimmed()
             .toDouble();
 
   } else {
-    scale = runReduceScriptFunction("print fit_settings['scale']")
+    scale = runReduceScriptFunction("print(fit_settings['scale'])")
                 .trimmed()
                 .toDouble();
-    shift = runReduceScriptFunction("print fit_settings['shift']")
+    shift = runReduceScriptFunction("print(fit_settings['shift'])")
                 .trimmed()
                 .toDouble();
   }
@@ -2761,11 +2761,11 @@ void SANSRunWindow::handleRunFindCentre() {
     beam_x = m_uiForm.rear_beam_x;
     beam_y = m_uiForm.rear_beam_y;
     coordinates_python_code =
-        "print i.ReductionSingleton().get_beam_center('rear')[0];print "
-        "i.ReductionSingleton().get_beam_center('rear')[1]";
+        "print(i.ReductionSingleton().get_beam_center('rear')[0]);print("
+        "i.ReductionSingleton().get_beam_center('rear')[1])";
   } else {
     coordinates_python_code =
-        "print i.ReductionSingleton().get_beam_center('front')[0];print "
+        "print(i.ReductionSingleton().get_beam_center('front')[0]);print("
         "i.ReductionSingleton().get_beam_center('front')[1]";
     m_uiForm.detbank_sel->setCurrentIndex(
         1); // FRONT selected -> detbank_sel <- FRONT
@@ -2888,9 +2888,9 @@ void SANSRunWindow::handleRunFindCentre() {
   runReduceScriptFunction(pyCode);
 
   QString errors =
-      runReduceScriptFunction("print "
+      runReduceScriptFunction("print("
                               "i.ReductionSingleton().user_settings.execute(i."
-                              "ReductionSingleton())").trimmed();
+                              "ReductionSingleton()))").trimmed();
 
   g_centreFinderLog.notice() << result.toStdString() << "\n";
 
@@ -2975,7 +2975,7 @@ void SANSRunWindow::handleDefSaveClick() {
       saveCommand += (*alg) + "('" + m_outputWS + "','" + fname + "')\n";
   }
 
-  saveCommand += "print 'success'\n";
+  saveCommand += "print('success')\n";
   QString result = runPythonCode(saveCommand).trimmed();
 
   // Revert changes and delete the zero-free workspace
@@ -3097,7 +3097,7 @@ void SANSRunWindow::handleInstrumentChange() {
   // and don't want to set the instrument twice.
   const QString currentInstName =
       runPythonCode(
-          "print i.ReductionSingleton().get_instrument().versioned_name()")
+          "print(i.ReductionSingleton().get_instrument().versioned_name())")
           .trimmed();
   if (currentInstName != m_uiForm.inst_opt->currentText()) {
     QString pyCode("i.ReductionSingleton.clean(isis_reducer.ISISReducer)");
@@ -3108,10 +3108,10 @@ void SANSRunWindow::handleInstrumentChange() {
   // now update the GUI
   fillDetectNames(m_uiForm.detbank_sel);
   QString detect = runReduceScriptFunction(
-      "print i.ReductionSingleton().instrument.cur_detector().name()");
+      "print(i.ReductionSingleton().instrument.cur_detector().name())");
   QString detectorSelection =
       runReduceScriptFunction(
-          "print i.ReductionSingleton().instrument.det_selection").trimmed();
+          "print(i.ReductionSingleton().instrument.det_selection)").trimmed();
   int ind = m_uiForm.detbank_sel->findText(detect);
   // We set the detector selection only if nothing is set yet.
   // Previously, we didn't handle merged and both at this point
@@ -3321,14 +3321,14 @@ void SANSRunWindow::updateTransInfo(int state) {
 
   if (state == Qt::Checked) {
     _min->setEnabled(true);
-    _min->setText(
-        runReduceScriptFunction(
-            "print i.ReductionSingleton().instrument.WAV_RANGE_MIN").trimmed());
+    _min->setText(runReduceScriptFunction(
+                      "print(i.ReductionSingleton().instrument.WAV_RANGE_MIN)")
+                      .trimmed());
 
     _max->setEnabled(true);
-    _max->setText(
-        runReduceScriptFunction(
-            "print i.ReductionSingleton().instrument.WAV_RANGE_MAX").trimmed());
+    _max->setText(runReduceScriptFunction(
+                      "print(i.ReductionSingleton().instrument.WAV_RANGE_MAX)")
+                      .trimmed());
 
   } else {
     _min->setEnabled(false);
@@ -3421,8 +3421,8 @@ bool SANSRunWindow::assignMonitorRun(API::MWRunFiles &trans,
   }
   assignCom.append(")");
   // assign the workspace name to a Python variable and read back some details
-  QString pythonC = "t1, t2 = " + assignCom + ";print '" + PYTHON_SEP +
-                    "',t1,'" + PYTHON_SEP + "',t2";
+  QString pythonC = "t1, t2 = " + assignCom + ";print('" + PYTHON_SEP +
+                    "' + ' ' +  t1 + ' ' + '" + PYTHON_SEP + "' + ' ' + t2)";
   QString ws_names = runReduceScriptFunction(pythonC);
   if (ws_names.startsWith("error", Qt::CaseInsensitive)) {
     throw std::runtime_error("Couldn't load a transmission file");
@@ -3477,7 +3477,7 @@ bool SANSRunWindow::assignDetBankRun(API::MWRunFiles &runFile,
   run_info += "SCATTER_SAMPLE = " + assignCom;
   run_info += ";ws_name = SCATTER_SAMPLE if not isinstance(SCATTER_SAMPLE, "
               "tuple) else SCATTER_SAMPLE[0]";
-  run_info += ";print '" + PYTHON_SEP + "',ws_name";
+  run_info += ";print('" + PYTHON_SEP + "' + ' ' + ws_name)";
   run_info = runReduceScriptFunction(run_info);
   if (run_info.startsWith("error", Qt::CaseInsensitive)) {
     throw std::runtime_error("Couldn't load sample or can");
@@ -3503,7 +3503,7 @@ bool SANSRunWindow::assignDetBankRun(API::MWRunFiles &runFile,
 */
 void SANSRunWindow::fillDetectNames(QComboBox *output) {
   QString detsTuple = runReduceScriptFunction(
-      "print i.ReductionSingleton().instrument.listDetectors()");
+      "print(i.ReductionSingleton().instrument.listDetectors())");
 
   if (detsTuple.isEmpty()) { // this happens if the run Python signal hasn't yet
                              // been connected
@@ -3817,24 +3817,24 @@ void SANSRunWindow::transSelectorChanged(int currindex) {
 void SANSRunWindow::loadTransmissionSettings() {
 
   QString transMin =
-      runReduceScriptFunction("print "
+      runReduceScriptFunction("print("
                               "i.ReductionSingleton().transmission_calculator."
-                              "lambdaMin('SAMPLE')").trimmed();
+                              "lambdaMin('SAMPLE'))").trimmed();
   if (transMin == "None") {
     m_uiForm.transFit_ck->setChecked(false);
   } else {
     m_uiForm.transFit_ck->setChecked(true);
     m_uiForm.trans_min->setText(transMin);
     m_uiForm.trans_max->setText(
-        runReduceScriptFunction("print "
+        runReduceScriptFunction("print("
                                 "i.ReductionSingleton().transmission_"
-                                "calculator.lambdaMax('SAMPLE')").trimmed());
+                                "calculator.lambdaMax('SAMPLE'))").trimmed());
   }
 
   QString text =
-      runReduceScriptFunction("print "
+      runReduceScriptFunction("print("
                               "i.ReductionSingleton().transmission_calculator."
-                              "fitMethod('SAMPLE')").trimmed();
+                              "fitMethod('SAMPLE'))").trimmed();
   int index = m_uiForm.trans_opt->findText(text, Qt::MatchFixedString);
   if (index >= 0) {
     m_uiForm.trans_opt->setCurrentIndex(index);
@@ -3844,22 +3844,22 @@ void SANSRunWindow::loadTransmissionSettings() {
   else
     m_uiForm.transFitOnOff->setChecked(true);
 
-  transMin = runReduceScriptFunction("print "
+  transMin = runReduceScriptFunction("print("
                                      "i.ReductionSingleton().transmission_"
-                                     "calculator.lambdaMin('CAN')").trimmed();
+                                     "calculator.lambdaMin('CAN'))").trimmed();
   if (transMin == "None") {
     m_uiForm.transFit_ck_can->setChecked(false);
   } else {
     m_uiForm.transFit_ck_can->setChecked(true);
     m_uiForm.trans_min_can->setText(transMin);
     m_uiForm.trans_max_can->setText(
-        runReduceScriptFunction("print "
+        runReduceScriptFunction("print("
                                 "i.ReductionSingleton().transmission_"
-                                "calculator.lambdaMax('CAN')").trimmed());
+                                "calculator.lambdaMax('CAN'))").trimmed());
   }
-  text = runReduceScriptFunction("print "
+  text = runReduceScriptFunction("print("
                                  "i.ReductionSingleton().transmission_"
-                                 "calculator.fitMethod('CAN')").trimmed();
+                                 "calculator.fitMethod('CAN'))").trimmed();
   index = m_uiForm.trans_opt_can->findText(text, Qt::MatchFixedString);
   if (index >= 0) {
     m_uiForm.trans_opt_can->setCurrentIndex(index);
@@ -3871,7 +3871,7 @@ void SANSRunWindow::loadTransmissionSettings() {
 
   bool separated =
       runReduceScriptFunction(
-          "print i.ReductionSingleton().transmission_calculator.isSeparate()")
+          "print(i.ReductionSingleton().transmission_calculator.isSeparate())")
           .trimmed() == "True";
 
   m_uiForm.trans_selector_opt->setCurrentIndex(separated ? 1 : 0);
@@ -3995,10 +3995,10 @@ void SANSRunWindow::createZeroErrorFreeClone(QString &originalWorkspaceName,
       isValidWsForRemovingZeroErrors(originalWorkspaceName)) {
     // Run the python script which creates the cloned workspace
     QString pythonCode(
-        "print i.CreateZeroErrorFreeClonedWorkspace(input_workspace_name='");
+        "print(i.CreateZeroErrorFreeClonedWorkspace(input_workspace_name='");
     pythonCode += originalWorkspaceName + "',";
-    pythonCode += " output_workspace_name='" + clonedWorkspaceName + "')\n";
-    pythonCode += "print '" + m_constants.getPythonSuccessKeyword() + "'\n";
+    pythonCode += " output_workspace_name='" + clonedWorkspaceName + "'))\n";
+    pythonCode += "print('" + m_constants.getPythonSuccessKeyword() + "')\n";
     QString result(runPythonCode(pythonCode, false));
     result = result.simplified();
     if (result != m_constants.getPythonSuccessKeyword()) {
@@ -4019,9 +4019,9 @@ void SANSRunWindow::deleteZeroErrorFreeClone(QString &clonedWorkspaceName) {
   if (workspaceExists(clonedWorkspaceName)) {
     // Run the python script which destroys the cloned workspace
     QString pythonCode(
-        "print i.DeleteZeroErrorFreeClonedWorkspace(input_workspace_name='");
-    pythonCode += clonedWorkspaceName + "')\n";
-    pythonCode += "print '" + m_constants.getPythonSuccessKeyword() + "'\n";
+        "print(i.DeleteZeroErrorFreeClonedWorkspace(input_workspace_name='");
+    pythonCode += clonedWorkspaceName + "'))\n";
+    pythonCode += "print('" + m_constants.getPythonSuccessKeyword() + "')\n";
     QString result(runPythonCode(pythonCode, false));
     result = result.simplified();
     if (result != m_constants.getPythonSuccessKeyword()) {
@@ -4039,9 +4039,9 @@ void SANSRunWindow::deleteZeroErrorFreeClone(QString &clonedWorkspaceName) {
  */
 bool SANSRunWindow::isValidWsForRemovingZeroErrors(QString &wsName) {
   QString pythonCode(
-      "\nprint i.IsValidWsForRemovingZeroErrors(input_workspace_name='");
-  pythonCode += wsName + "')";
-  pythonCode += "\nprint '" + m_constants.getPythonSuccessKeyword() + "'";
+      "\nprint(i.IsValidWsForRemovingZeroErrors(input_workspace_name='");
+  pythonCode += wsName + "'))";
+  pythonCode += "\nprint('" + m_constants.getPythonSuccessKeyword() + "')";
   QString result(runPythonCode(pythonCode, false));
   result = result.simplified();
   bool isValid = true;
@@ -4148,7 +4148,7 @@ void SANSRunWindow::setTransmissionSettingsFromUserFile() {
   resetAllTransFields();
 
   // Read the Radius settings
-  QString transmissionRadiusRequest("\nprint i.GetTransmissionRadiusInMM()");
+  QString transmissionRadiusRequest("\nprint(i.GetTransmissionRadiusInMM())");
   QString resultTransmissionRadius(
       runPythonCode(transmissionRadiusRequest, false));
   resultTransmissionRadius = resultTransmissionRadius.simplified();
@@ -4159,13 +4159,13 @@ void SANSRunWindow::setTransmissionSettingsFromUserFile() {
   }
 
   // Read the ROI settings
-  QString transmissionROIRequest("\nprint i.GetTransmissionROI()");
+  QString transmissionROIRequest("\nprint(i.GetTransmissionROI())");
   QString resultTransmissionROI(runPythonCode(transmissionROIRequest, false));
   resultTransmissionROI = resultTransmissionROI.simplified();
   if (resultTransmissionROI != m_constants.getPythonEmptyKeyword()) {
     resultTransmissionROI =
-        runPythonCode("\nprint i.ConvertFromPythonStringList(to_convert=" +
-                          resultTransmissionROI + ")",
+        runPythonCode("\nprint(i.ConvertFromPythonStringList(to_convert=" +
+                          resultTransmissionROI + "))",
                       false);
     this->m_uiForm.trans_roi_files_line_edit->setText(resultTransmissionROI);
     this->m_uiForm.trans_roi_files_checkbox->setChecked(true);
@@ -4173,20 +4173,20 @@ void SANSRunWindow::setTransmissionSettingsFromUserFile() {
   }
 
   // Read the MASK settings
-  QString transmissionMaskRequest("\nprint i.GetTransmissionMask()");
+  QString transmissionMaskRequest("\nprint(i.GetTransmissionMask())");
   QString resultTransmissionMask(runPythonCode(transmissionMaskRequest, false));
   resultTransmissionMask = resultTransmissionMask.simplified();
   if (resultTransmissionMask != m_constants.getPythonEmptyKeyword()) {
     resultTransmissionMask =
-        runPythonCode("\nprint i.ConvertFromPythonStringList(to_convert=" +
-                          resultTransmissionMask + ")",
+        runPythonCode("\nprint(i.ConvertFromPythonStringList(to_convert=" +
+                          resultTransmissionMask + "))",
                       false);
     this->m_uiForm.trans_masking_line_edit->setText(resultTransmissionMask);
   }
 
   // Read the Transmission Monitor Spectrum Shift
   QString transmissionMonitorSpectrumShiftRequest(
-      "\nprint i.GetTransmissionMonitorSpectrumShift()");
+      "\nprint(i.GetTransmissionMonitorSpectrumShift())");
   QString resultTransmissionMonitorSpectrumShift(
       runPythonCode(transmissionMonitorSpectrumShiftRequest, false));
   resultTransmissionMonitorSpectrumShift =
@@ -4201,7 +4201,7 @@ void SANSRunWindow::setTransmissionSettingsFromUserFile() {
   // selected, then this takes precedence over
   // the radius, roi and mask settings
   QString transmissionMonitorSpectrumRequest(
-      "\nprint i.GetTransmissionMonitorSpectrum()");
+      "\nprint(i.GetTransmissionMonitorSpectrum())");
   QString resultTransmissionMonitorSpectrum(
       runPythonCode(transmissionMonitorSpectrumRequest, false));
   resultTransmissionMonitorSpectrum =
@@ -4364,16 +4364,17 @@ void SANSRunWindow::writeTransmissionSettingsToPythonScript(
     auto roi = m_uiForm.trans_roi_files_line_edit->text();
     if (m_uiForm.trans_roi_files_checkbox->isChecked() && !roi.isEmpty()) {
       roi = "'" + roi.simplified() + "'";
-      roi = runPythonCode(
-          "\nprint i.ConvertToPythonStringList(to_convert=" + roi + ")", false);
+      roi = runPythonCode("\nprint(i.ConvertToPythonStringList(to_convert=" +
+                              roi + "))",
+                          false);
       pythonCode += "i.SetTransmissionROI(trans_roi_files=" + roi + ")\n";
     }
     // Handle Mask
     auto mask = m_uiForm.trans_masking_line_edit->text();
     if (!mask.isEmpty()) {
       mask = "'" + mask.simplified() + "'";
-      mask = runPythonCode("\nprint i.ConvertToPythonStringList(to_convert=" +
-                               mask + ")",
+      mask = runPythonCode("\nprint(i.ConvertToPythonStringList(to_convert=" +
+                               mask + "))",
                            false);
       pythonCode += "i.SetTransmissionMask(trans_mask_files=" + mask + ")\n";
     }
@@ -4539,29 +4540,30 @@ void SANSRunWindow::updateBeamCenterCoordinates() {
   // from the ticket #5942 both detectors have center coordinates
   double dbl_param =
       runReduceScriptFunction(
-          "print i.ReductionSingleton().get_beam_center('rear')[0]").toDouble();
+          "print(i.ReductionSingleton().get_beam_center('rear')[0])")
+          .toDouble();
   // get the scale factor1 for the beam centre to scale it correctly
   double dbl_paramsf =
       runReduceScriptFunction(
-          "print i.ReductionSingleton().get_beam_center_scale_factor1()")
+          "print(i.ReductionSingleton().get_beam_center_scale_factor1())")
           .toDouble();
   m_uiForm.rear_beam_x->setText(QString::number(dbl_param * dbl_paramsf));
   // get scale factor2 for the beam centre to scale it correctly
   dbl_paramsf =
       runReduceScriptFunction(
-          "print i.ReductionSingleton().get_beam_center_scale_factor2()")
+          "print(i.ReductionSingleton().get_beam_center_scale_factor2())")
           .toDouble();
-  dbl_param =
-      runReduceScriptFunction(
-          "print i.ReductionSingleton().get_beam_center('rear')[1]").toDouble();
+  dbl_param = runReduceScriptFunction(
+                  "print(i.ReductionSingleton().get_beam_center('rear')[1])")
+                  .toDouble();
   m_uiForm.rear_beam_y->setText(QString::number(dbl_param * dbl_paramsf));
   // front
   dbl_param = runReduceScriptFunction(
-                  "print i.ReductionSingleton().get_beam_center('front')[0]")
+                  "print(i.ReductionSingleton().get_beam_center('front')[0])")
                   .toDouble();
   m_uiForm.front_beam_x->setText(QString::number(dbl_param * 1000.0));
   dbl_param = runReduceScriptFunction(
-                  "print i.ReductionSingleton().get_beam_center('front')[1]")
+                  "print(i.ReductionSingleton().get_beam_center('front')[1])")
                   .toDouble();
   m_uiForm.front_beam_y->setText(QString::number(dbl_param * 1000.0));
 }
@@ -4576,7 +4578,7 @@ void SANSRunWindow::setBeamFinderDetails() {
   // Set the labels according to the instrument
   auto requiresAngle =
       runReduceScriptFunction(
-          "print i.is_current_workspace_an_angle_workspace()").simplified();
+          "print(i.is_current_workspace_an_angle_workspace())").simplified();
   QString labelPosition;
   if (requiresAngle == m_constants.getPythonTrueKeyword()) {
     labelPosition = "Current ( " + QString(QChar(0x03B2)) + " , y ) [";
diff --git a/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/ColorBarWidget.h b/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/ColorBarWidget.h
index 3a1bba8ffa677d2fbc25de56cb54c0eef53be60c..87add06d539c43e0fef96f072b9235734f71d9e3 100644
--- a/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/ColorBarWidget.h
+++ b/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/ColorBarWidget.h
@@ -49,7 +49,8 @@ public:
   enum CheckboxStrategy {
     ADD_AUTOSCALE_CURRENT_SLICE = 0,
     ADD_AUTOSCALE_ON_LOAD = 1,
-    ADD_AUTOSCALE_BOTH = 2
+    ADD_AUTOSCALE_BOTH = 2,
+    ADD_AUTOSCALE_NONE = 3
   };
 
   void updateColorMap();
diff --git a/MantidQt/MantidWidgets/src/ColorBarWidget.cpp b/MantidQt/MantidWidgets/src/ColorBarWidget.cpp
index 8dc2607891164770991667e84b317b531e30a804..b1643962961127d14e7713f0e11531a618b0931e 100644
--- a/MantidQt/MantidWidgets/src/ColorBarWidget.cpp
+++ b/MantidQt/MantidWidgets/src/ColorBarWidget.cpp
@@ -100,7 +100,7 @@ void ColorBarWidget::setRenderMode(bool rendering) {
 *	 ADD_AUTOSCALE_CURRENT_SLICE
 *	 ADD_AUTOSCALE_ON_LOAD
 *	 ADD_AUTOSCALE_BOTH
-*
+*	 ADD_AUTOSCALE_NONE
 * @param strategy :: select which checkboxes are shown
 */
 void ColorBarWidget::setCheckBoxMode(CheckboxStrategy strategy) {
@@ -126,6 +126,13 @@ void ColorBarWidget::setCheckBoxMode(CheckboxStrategy strategy) {
     ui.autoScaleForCurrentSlice->setVisible(true);
     ui.autoScaleForCurrentSlice->setEnabled(true);
     break;
+
+  case ADD_AUTOSCALE_NONE: // for exporting images
+    ui.autoScale->setVisible(false);
+    ui.autoScale->setEnabled(false);
+    ui.autoScaleForCurrentSlice->setVisible(false);
+    ui.autoScaleForCurrentSlice->setEnabled(false);
+    break;
   }
 }
 
diff --git a/MantidQt/MantidWidgets/src/FitPropertyBrowser.cpp b/MantidQt/MantidWidgets/src/FitPropertyBrowser.cpp
index bd4636e3c38043892f38aa6e514a8a5cf62263e5..802c20883ea99d7e2c1b003cc808e921249c13b9 100644
--- a/MantidQt/MantidWidgets/src/FitPropertyBrowser.cpp
+++ b/MantidQt/MantidWidgets/src/FitPropertyBrowser.cpp
@@ -9,19 +9,14 @@
 #include "MantidAPI/IBackgroundFunction.h"
 #include "MantidAPI/CompositeFunction.h"
 #include "MantidAPI/AlgorithmManager.h"
-#include "MantidAPI/ConstraintFactory.h"
 #include "MantidAPI/CostFunctionFactory.h"
-#include "MantidAPI/Expression.h"
-#include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/FuncMinimizerFactory.h"
-#include "MantidAPI/IConstraint.h"
 #include "MantidAPI/ICostFunction.h"
 #include "MantidAPI/IFuncMinimizer.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/ParameterTie.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidAPI/WorkspaceFactory.h"
-#include "MantidAPI/WorkspaceGroup.h"
 
 #include "MantidKernel/ConfigService.h"
 #include "MantidKernel/LibraryManager.h"
@@ -31,7 +26,6 @@
 #include "MantidQtMantidWidgets/StringEditorFactory.h"
 
 #include "qttreepropertybrowser.h"
-#include "qtpropertymanager.h"
 #include "qteditorfactory.h"
 #include "DoubleEditorFactory.h"
 #include "ParameterPropertyManager.h"
@@ -39,18 +33,15 @@
 #include <Poco/ActiveResult.h>
 
 #include <QVBoxLayout>
-#include <QHBoxLayout>
 #include <QGridLayout>
 #include <QPushButton>
 #include <QMenu>
 #include <QMessageBox>
 #include <QInputDialog>
 #include <QSettings>
-#include <QFileInfo>
 #include <QApplication>
 #include <QClipboard>
 #include <QSignalMapper>
-#include <QMetaMethod>
 #include <QTreeWidget>
 #include <QUrl>
 
@@ -1059,9 +1050,9 @@ void FitPropertyBrowser::setWorkspaceName(const QString &wsName) {
     }
     if (mws) {
       size_t wi = static_cast<size_t>(workspaceIndex());
-      if (wi < mws->getNumberHistograms() && !mws->readX(wi).empty()) {
-        setStartX(mws->readX(wi).front());
-        setEndX(mws->readX(wi).back());
+      if (wi < mws->getNumberHistograms() && !mws->x(wi).empty()) {
+        setStartX(mws->x(wi).front());
+        setEndX(mws->x(wi).back());
       }
     }
   }
@@ -2919,9 +2910,10 @@ FitPropertyBrowser::createMatrixFromTableWorkspace() const {
     Mantid::API::MatrixWorkspace_sptr mws =
         Mantid::API::WorkspaceFactory::Instance().create("Workspace2D", 1,
                                                          rowCount, rowCount);
-    Mantid::MantidVec &X = mws->dataX(0);
-    Mantid::MantidVec &Y = mws->dataY(0);
-    Mantid::MantidVec &E = mws->dataE(0);
+    auto &X = mws->mutableX(0);
+    auto &Y = mws->mutableY(0);
+    auto &E = mws->mutableE(0);
+
     for (size_t row = 0; row < rowCount; ++row) {
       X[row] = xcol->toDouble(row);
       Y[row] = ycol->toDouble(row);
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp
index 5f325aa7118f15aee09f388e3543459f4fb38ef0..7308666ca938fb050c0c3f5399e8541d4b0ed544 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp
@@ -6,11 +6,9 @@
 #include "MantidQtMantidWidgets/InstrumentView/ObjCompAssemblyActor.h"
 #include "MantidQtMantidWidgets/InstrumentView/ObjComponentActor.h"
 #include "MantidQtMantidWidgets/InstrumentView/RectangularDetectorActor.h"
-#include "MantidQtMantidWidgets/InstrumentView/SampleActor.h"
 #include "MantidQtMantidWidgets/InstrumentView/StructuredDetectorActor.h"
 
 #include "MantidAPI/AnalysisDataService.h"
-#include "MantidAPI/Axis.h"
 #include "MantidAPI/CommonBinsValidator.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/IAlgorithm.h"
@@ -19,10 +17,7 @@
 #include "MantidAPI/SpectrumInfo.h"
 #include "MantidAPI/WorkspaceFactory.h"
 
-#include "MantidGeometry/Objects/Object.h"
-#include "MantidGeometry/ICompAssembly.h"
 #include "MantidGeometry/Instrument.h"
-#include "MantidGeometry/IObjComponent.h"
 
 #include "MantidKernel/ConfigService.h"
 #include "MantidKernel/Exception.h"
@@ -133,7 +128,7 @@ void InstrumentActor::setUpWorkspace(
   m_WkspBinMinValue = DBL_MAX;
   m_WkspBinMaxValue = -DBL_MAX;
   for (size_t i = 0; i < nHist; ++i) {
-    const Mantid::MantidVec &values = sharedWorkspace->readX(i);
+    const auto &values = sharedWorkspace->x(i);
     double xtest = values.front();
     if (!std::isinf(xtest)) {
       if (xtest < m_WkspBinMinValue) {
@@ -502,21 +497,14 @@ void InstrumentActor::sumDetectorsUniform(QList<int> &dets,
   getBinMinMaxIndex(wi, imin, imax);
 
   Mantid::API::MatrixWorkspace_const_sptr ws = getWorkspace();
-  const Mantid::MantidVec &X = ws->readX(wi);
-  x.assign(X.begin() + imin, X.begin() + imax);
-  if (ws->isHistogramData()) {
-    // calculate the bin centres
-    std::transform(x.begin(), x.end(), X.begin() + imin + 1, x.begin(),
-                   std::plus<double>());
-    std::transform(x.begin(), x.end(), x.begin(),
-                   std::bind2nd(std::divides<double>(), 2.0));
-  }
+  const auto &XPoints = ws->points(wi);
+  x.assign(XPoints.begin() + imin, XPoints.begin() + imax);
   y.resize(x.size(), 0);
   // sum the spectra
   foreach (int id, dets) {
     try {
       size_t index = getWorkspaceIndex(id);
-      const Mantid::MantidVec &Y = ws->readY(index);
+      const auto &Y = ws->y(index);
       std::transform(y.begin(), y.end(), Y.begin() + imin, y.begin(),
                      std::plus<double>());
     } catch (Mantid::Kernel::Exception::NotFoundError &) {
@@ -560,17 +548,13 @@ void InstrumentActor::sumDetectorsRagged(QList<int> &dets,
   foreach (int id, dets) {
     try {
       size_t index = getWorkspaceIndex(id);
-      dws->dataX(nSpec) = ws->readX(index);
-      dws->dataY(nSpec) = ws->readY(index);
-      dws->dataE(nSpec) = ws->readE(index);
-      double xmin = dws->readX(nSpec).front();
-      double xmax = dws->readX(nSpec).back();
-      if (xmin < xStart) {
+      dws->setHistogram(nSpec, ws->histogram(index));
+      double xmin = dws->x(nSpec).front();
+      double xmax = dws->x(nSpec).back();
+      if (xmin < xStart)
         xStart = xmin;
-      }
-      if (xmax > xEnd) {
+      if (xmax > xEnd)
         xEnd = xmax;
-      }
       ++nSpec;
     } catch (Mantid::Kernel::Exception::NotFoundError &) {
       continue; // Detector doesn't have a workspace index relating to it
@@ -584,13 +568,11 @@ void InstrumentActor::sumDetectorsRagged(QList<int> &dets,
   }
 
   // limits should exceed the integration range
-  if (xStart < minBinValue()) {
+  if (xStart < minBinValue())
     xStart = minBinValue();
-  }
 
-  if (xEnd > maxBinValue()) {
+  if (xEnd > maxBinValue())
     xEnd = maxBinValue();
-  }
 
   double dx = (xEnd - xStart) / static_cast<double>(size - 1);
   std::string params =
@@ -610,11 +592,14 @@ void InstrumentActor::sumDetectorsRagged(QList<int> &dets,
         Mantid::API::AnalysisDataService::Instance().retrieve(outName));
     Mantid::API::AnalysisDataService::Instance().remove(outName);
 
-    x = ws->readX(0);
-    y = ws->readY(0);
+    const auto &X = ws->x(0);
+    const auto &Y = ws->y(0);
+    x.assign(X.begin(), X.end());
+    y.assign(Y.begin(), Y.end());
+
     // add the spectra
     for (size_t i = 0; i < nSpec; ++i) {
-      const Mantid::MantidVec &Y = ws->readY(i);
+      const auto &Y = ws->y(i);
       std::transform(y.begin(), y.end(), Y.begin(), y.begin(),
                      std::plus<double>());
     }
@@ -1052,29 +1037,27 @@ void InstrumentActor::rotateToLookAt(const Mantid::Kernel::V3D &eye,
 /**
 * Find the offsets in the spectrum's x vector of the bounds of integration.
 * @param wi :: The works[ace index of the spectrum.
-* @param imin :: Index of the lower bound: x_min == readX(wi)[imin]
-* @param imax :: Index of the upper bound: x_max == readX(wi)[imax]
+* @param imin :: Index of the lower bound: x_min == x(wi)[imin]
+* @param imax :: Index of the upper bound: x_max == x(wi)[imax]
 */
 void InstrumentActor::getBinMinMaxIndex(size_t wi, size_t &imin,
                                         size_t &imax) const {
   Mantid::API::MatrixWorkspace_const_sptr ws = getWorkspace();
-  const Mantid::MantidVec &x = ws->readX(wi);
-  Mantid::MantidVec::const_iterator x_begin = x.begin();
-  Mantid::MantidVec::const_iterator x_end = x.end();
-  if (x_begin == x_end) {
+  const auto &x = ws->x(wi);
+
+  auto x_begin = x.begin();
+  auto x_end = x.end();
+  if (x_begin == x_end)
     throw std::runtime_error("No bins found to plot");
-  }
-  if (ws->isHistogramData()) {
+  if (ws->isHistogramData())
     --x_end;
-  }
+
   if (wholeRange()) {
     imin = 0;
     imax = static_cast<size_t>(x_end - x_begin);
   } else {
-    Mantid::MantidVec::const_iterator x_from =
-        std::lower_bound(x_begin, x_end, minBinValue());
-    Mantid::MantidVec::const_iterator x_to =
-        std::upper_bound(x_begin, x_end, maxBinValue());
+    auto x_from = std::lower_bound(x_begin, x_end, minBinValue());
+    auto x_to = std::upper_bound(x_begin, x_end, maxBinValue());
     imin = static_cast<size_t>(x_from - x_begin);
     imax = static_cast<size_t>(x_to - x_begin);
     if (imax <= imin) {
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp
index 5d689e8cc0b4c1d83a2bf4cd9ae76acd21f94883..d119bd9ed1f15e72636b48b6ed01813aa2c7ef0e 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp
@@ -14,11 +14,9 @@
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/IPeaksWorkspace.h"
-#include "MantidAPI/ITableWorkspace.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/Sample.h"
 #include "MantidAPI/WorkspaceFactory.h"
-#include "MantidAPI/TableRow.h"
 #include "MantidGeometry/Crystal/OrientedLattice.h"
 #include "MantidKernel/V3D.h"
 
@@ -32,14 +30,9 @@
 #include <QMenu>
 #include <QAction>
 #include <QActionGroup>
-#include <QWidgetAction>
 #include <QLabel>
 #include <QMessageBox>
-#include <QDialog>
 #include <QGridLayout>
-#include <QHBoxLayout>
-#include <QComboBox>
-#include <QLineEdit>
 #include <QSignalMapper>
 #include <QPixmap>
 #include <QSettings>
@@ -1349,24 +1342,16 @@ void DetectorPlotController::prepareDataForSinglePlot(
     return; // Detector doesn't have a workspace index relating to it
   }
   // get the data
-  const Mantid::MantidVec &X = ws->readX(wi);
-  const Mantid::MantidVec &Y = ws->readY(wi);
-  const Mantid::MantidVec &E = ws->readE(wi);
+  const auto &XPoints = ws->points(wi);
+  const auto &Y = ws->y(wi);
+  const auto &E = ws->e(wi);
 
   // find min and max for x
   size_t imin, imax;
   m_instrActor->getBinMinMaxIndex(wi, imin, imax);
 
-  x.assign(X.begin() + imin, X.begin() + imax);
+  x.assign(XPoints.begin() + imin, XPoints.begin() + imax);
   y.assign(Y.begin() + imin, Y.begin() + imax);
-  if (ws->isHistogramData()) {
-    // calculate the bin centres
-    std::transform(x.begin(), x.end(), X.begin() + imin + 1, x.begin(),
-                   std::plus<double>());
-    std::transform(x.begin(), x.end(), x.begin(),
-                   std::bind2nd(std::divides<double>(), 2.0));
-  }
-
   if (err) {
     err->assign(E.begin() + imin, E.begin() + imax);
   }
@@ -1402,19 +1387,11 @@ void DetectorPlotController::prepareDataForSumsPlot(int detid,
   size_t imin, imax;
   m_instrActor->getBinMinMaxIndex(wi, imin, imax);
 
-  const Mantid::MantidVec &X = ws->readX(wi);
-  x.assign(X.begin() + imin, X.begin() + imax);
-  if (ws->isHistogramData()) {
-    // calculate the bin centres
-    std::transform(x.begin(), x.end(), X.begin() + imin + 1, x.begin(),
-                   std::plus<double>());
-    std::transform(x.begin(), x.end(), x.begin(),
-                   std::bind2nd(std::divides<double>(), 2.0));
-  }
+  const auto &XPoints = ws->points(wi);
+  x.assign(XPoints.begin() + imin, XPoints.begin() + imax);
   y.resize(x.size(), 0);
-  if (err) {
+  if (err)
     err->resize(x.size(), 0);
-  }
 
   const int n = ass->nelements();
   for (int i = 0; i < n; ++i) {
@@ -1423,11 +1400,11 @@ void DetectorPlotController::prepareDataForSumsPlot(int detid,
     if (idet) {
       try {
         size_t index = m_instrActor->getWorkspaceIndex(idet->getID());
-        const Mantid::MantidVec &Y = ws->readY(index);
+        const auto &Y = ws->y(index);
         std::transform(y.begin(), y.end(), Y.begin() + imin, y.begin(),
                        std::plus<double>());
         if (err) {
-          const Mantid::MantidVec &E = ws->readE(index);
+          const auto &E = ws->e(index);
           std::vector<double> tmp;
           tmp.assign(E.begin() + imin, E.begin() + imax);
           std::transform(tmp.begin(), tmp.end(), tmp.begin(), tmp.begin(),
@@ -1441,9 +1418,8 @@ void DetectorPlotController::prepareDataForSumsPlot(int detid,
     }
   }
 
-  if (err) {
+  if (err)
     std::transform(err->begin(), err->end(), err->begin(), Sqrt());
-  }
 }
 
 /**
@@ -1549,11 +1525,11 @@ void DetectorPlotController::prepareDataForIntegralsPlot(
         }
         size_t index = m_instrActor->getWorkspaceIndex(id);
         // get the y-value for detector idet
-        const Mantid::MantidVec &Y = ws->readY(index);
+        const auto &Y = ws->y(index);
         double sum = std::accumulate(Y.begin() + imin, Y.begin() + imax, 0);
         xymap[xvalue] = sum;
         if (err) {
-          const Mantid::MantidVec &E = ws->readE(index);
+          const auto &E = ws->e(index);
           std::vector<double> tmp(imax - imin);
           // take squares of the errors
           std::transform(E.begin() + imin, E.begin() + imax, E.begin() + imin,
diff --git a/MantidQt/MantidWidgets/src/PreviewPlot.cpp b/MantidQt/MantidWidgets/src/PreviewPlot.cpp
index 99675bf740115e25713d6e7f0da81ccf16cf0b8e..70d4355bfdc5b8f62bce4d09991aad89415d40a5 100644
--- a/MantidQt/MantidWidgets/src/PreviewPlot.cpp
+++ b/MantidQt/MantidWidgets/src/PreviewPlot.cpp
@@ -5,18 +5,12 @@
 
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/AlgorithmManager.h"
-#include "MantidAPI/MatrixWorkspace.h"
-#include "MantidKernel/VectorHelper.h"
 
 #include <Poco/Notification.h>
 #include <Poco/NotificationCenter.h>
-#include <Poco/AutoPtr.h>
-#include <Poco/NObserver.h>
 
 #include <QAction>
-#include <QBrush>
 #include <QPalette>
-#include <QVBoxLayout>
 
 #include <qwt_array.h>
 #include <qwt_data.h>
@@ -624,7 +618,7 @@ void PreviewPlot::addCurve(PlotCurveConfiguration &curveConfig,
     throw std::runtime_error("Workspace index is out of range, cannot plot.");
 
   // Check the X axis is large enough
-  if (ws->readX(0).size() < 2)
+  if (ws->x(0).size() < 2)
     throw std::runtime_error(
         "X axis is too small to generate a histogram plot.");
 
@@ -644,7 +638,7 @@ void PreviewPlot::addCurve(PlotCurveConfiguration &curveConfig,
     ws = convertXAlg->getProperty("OutputWorkspace");
   }
 
-  std::vector<double> wsDataY = ws->readY(wsIndex);
+  auto wsDataY = ws->y(wsIndex);
 
   // If using log scale need to remove all negative Y values
   bool logYScale = getAxisType(QwtPlot::yLeft) == "Logarithmic";
@@ -663,14 +657,10 @@ void PreviewPlot::addCurve(PlotCurveConfiguration &curveConfig,
   }
 
   // Create the Qwt data
-  std::vector<double> X;
-  if (ws->isHistogramData()) {
-    Mantid::Kernel::VectorHelper::convertToBinCentre(ws->readX(wsIndex), X);
-  } else {
-    X = ws->readX(wsIndex);
-  }
-  QwtArray<double> dataX = QVector<double>::fromStdVector(X);
-  QwtArray<double> dataY = QVector<double>::fromStdVector(wsDataY);
+  const auto &wsXPoints = ws->points(wsIndex);
+
+  QwtArray<double> dataX = QVector<double>::fromStdVector(wsXPoints.rawData());
+  QwtArray<double> dataY = QVector<double>::fromStdVector(wsDataY.rawData());
   QwtArrayData wsData(dataX, dataY);
 
   // Create the new curve
@@ -682,7 +672,7 @@ void PreviewPlot::addCurve(PlotCurveConfiguration &curveConfig,
   // Create error bars if needed
   if (curveConfig.showErrorsAction->isChecked()) {
     curveConfig.errorCurve =
-        new ErrorCurve(curveConfig.curve, ws->readE(wsIndex));
+        new ErrorCurve(curveConfig.curve, ws->e(wsIndex).rawData());
     curveConfig.errorCurve->attach(m_uiForm.plot);
   } else {
     curveConfig.errorCurve = NULL;
diff --git a/MantidQt/MantidWidgets/src/PropertyHandler.cpp b/MantidQt/MantidWidgets/src/PropertyHandler.cpp
index 7af313f7374a14d9cad04166f93ae87a7f22c112..816a61d2abfb5373c1b7155850c802cb1bb2a9f6 100644
--- a/MantidQt/MantidWidgets/src/PropertyHandler.cpp
+++ b/MantidQt/MantidWidgets/src/PropertyHandler.cpp
@@ -1,6 +1,5 @@
 #include "MantidQtMantidWidgets/PropertyHandler.h"
 #include "MantidQtMantidWidgets/FitPropertyBrowser.h"
-//#include "../FunctionCurve.h"
 
 #include "MantidAPI/FunctionFactory.h"
 #include "MantidAPI/IPeakFunction.h"
@@ -12,7 +11,6 @@
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/MatrixWorkspace.h"
-#include "MantidAPI/IFunction1D.h"
 #include "MantidAPI/FunctionDomain1D.h"
 #include "MantidAPI/FunctionValues.h"
 
@@ -21,7 +19,6 @@
 #include "ParameterPropertyManager.h"
 
 #include <QMessageBox>
-#include <QMenu>
 
 using std::size_t;
 
@@ -370,13 +367,12 @@ PropertyHandler *PropertyHandler::addFunction(const std::string &fnName) {
   // from data values at the ends of the fitting interval
   if (f->name() == "LinearBackground" && !m_browser->workspaceName().empty()) {
     if (ws && wi < ws->getNumberHistograms()) {
-      const Mantid::MantidVec &X = ws->readX(wi);
+      const auto &X = ws->x(wi);
       size_t istart = 0, iend = 0;
       for (size_t i = 0; i < X.size() - 1; ++i) {
         double x = X[i];
-        if (x < m_browser->startX()) {
+        if (x < m_browser->startX())
           istart = i;
-        }
         if (x > m_browser->endX()) {
           iend = i;
           if (iend > 0)
@@ -385,7 +381,7 @@ PropertyHandler *PropertyHandler::addFunction(const std::string &fnName) {
         }
       }
       if (iend > istart) {
-        const Mantid::MantidVec &Y = ws->readY(wi);
+        const auto &Y = ws->y(wi);
         double p0 = Y[istart];
         double p1 = Y[iend];
         double A1 = (p1 - p0) / (X[iend] - X[istart]);
@@ -1113,8 +1109,8 @@ double PropertyHandler::EstimateFwhm() const {
       m_browser->getWorkspace());
   if (ws) {
     size_t wi = m_browser->workspaceIndex();
-    const Mantid::MantidVec &X = ws->readX(wi);
-    const Mantid::MantidVec &Y = ws->readY(wi);
+    const auto &X = ws->x(wi);
+    const auto &Y = ws->y(wi);
     size_t n = Y.size() - 1;
     if (m_ci < 0 || m_ci > static_cast<int>(n)) {
       fwhm = 0.;
@@ -1160,8 +1156,8 @@ void PropertyHandler::calcBase() {
       m_browser->getWorkspace());
   if (ws) {
     size_t wi = m_browser->workspaceIndex();
-    const Mantid::MantidVec &X = ws->readX(wi);
-    const Mantid::MantidVec &Y = ws->readY(wi);
+    const auto &X = ws->x(wi);
+    const auto &Y = ws->y(wi);
     int n = static_cast<int>(Y.size()) - 1;
     if (m_ci < 0 || m_ci > n || !m_browser->m_autoBackground) {
       m_base = 0.;
@@ -1218,7 +1214,7 @@ void PropertyHandler::setCentre(const double &c) {
         m_browser->getWorkspace());
     if (ws) {
       size_t wi = m_browser->workspaceIndex();
-      const Mantid::MantidVec &X = ws->readX(wi);
+      const auto &X = ws->x(wi);
       int n = static_cast<int>(X.size()) - 2;
       if (m_ci < 0)
         m_ci = 0;
diff --git a/MantidQt/MantidWidgets/src/WorkspacePresenter/QWorkspaceDockView.cpp b/MantidQt/MantidWidgets/src/WorkspacePresenter/QWorkspaceDockView.cpp
index 1a7ed1fa4e9b064d706635f877bcb958662d377d..1afc332d28e808c27590145d2a1cc5ea7f1c740b 100644
--- a/MantidQt/MantidWidgets/src/WorkspacePresenter/QWorkspaceDockView.cpp
+++ b/MantidQt/MantidWidgets/src/WorkspacePresenter/QWorkspaceDockView.cpp
@@ -1279,6 +1279,9 @@ void QWorkspaceDockView::popupContextMenu() {
     } else if (boost::dynamic_pointer_cast<const Mantid::API::ITableWorkspace>(
                    ws)) {
       addTableWorkspaceMenuItems(menu);
+    } else {
+      // None of the above? -> not a workspace
+      return;
     }
     addClearMenuItems(menu, selectedWsName);
 
diff --git a/MantidQt/MantidWidgets/test/ProjectSaveModelTest.h b/MantidQt/MantidWidgets/test/ProjectSaveModelTest.h
index ec618c11b49a5709d4f532efd611ec962166c8c6..218c36ed5fadec987d8cea4a72804b4156d7e9e8 100644
--- a/MantidQt/MantidWidgets/test/ProjectSaveModelTest.h
+++ b/MantidQt/MantidWidgets/test/ProjectSaveModelTest.h
@@ -19,9 +19,9 @@ class ProjectSaveModelTest : public CxxTest::TestSuite {
 
 public:
   void setUp() override {
-    auto ws1 = WorkspaceCreationHelper::create1DWorkspaceRand(10);
+    auto ws1 = WorkspaceCreationHelper::create1DWorkspaceRand(10, true);
     WorkspaceCreationHelper::storeWS("ws1", ws1);
-    auto ws2 = WorkspaceCreationHelper::create1DWorkspaceRand(10);
+    auto ws2 = WorkspaceCreationHelper::create1DWorkspaceRand(10, true);
     WorkspaceCreationHelper::storeWS("ws2", ws2);
   }
 
diff --git a/MantidQt/MantidWidgets/test/ProjectSavePresenterTest.h b/MantidQt/MantidWidgets/test/ProjectSavePresenterTest.h
index 9d5d869714a4615d25db38dd376915684f8b8547..bac9993a488b73a1f71bbbb4250d5ebd7d873446 100644
--- a/MantidQt/MantidWidgets/test/ProjectSavePresenterTest.h
+++ b/MantidQt/MantidWidgets/test/ProjectSavePresenterTest.h
@@ -333,7 +333,7 @@ public:
     std::vector<WorkspaceInfo> wsInfo;
 
     for (auto &name : workspaces) {
-      auto ws = WorkspaceCreationHelper::create1DWorkspaceRand(10);
+      auto ws = WorkspaceCreationHelper::create1DWorkspaceRand(10, true);
       WorkspaceCreationHelper::storeWS(name, ws);
       WorkspaceInfo info;
       info.name = name;
diff --git a/MantidQt/RefDetectorViewer/src/RefMatrixWSImageView.cpp b/MantidQt/RefDetectorViewer/src/RefMatrixWSImageView.cpp
index 28d73d639fb48ebb0cce65961e3c0f00631f5b29..72e74bb1b358b16d57cf128b1a4f767f1604e8a2 100644
--- a/MantidQt/RefDetectorViewer/src/RefMatrixWSImageView.cpp
+++ b/MantidQt/RefDetectorViewer/src/RefMatrixWSImageView.cpp
@@ -4,7 +4,6 @@
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/WorkspaceProperty.h"
 #include "MantidAPI/Algorithm.h"
-#include "MantidKernel/System.h"
 #include "MantidAPI/IEventWorkspace.h"
 
 using Mantid::API::MatrixWorkspace_sptr;
@@ -40,7 +39,7 @@ RefMatrixWSImageView::RefMatrixWSImageView(QString wpsName, int peakMin,
   const double totalYMax = 255.0; // 303
   const size_t totalRows = 256;   // 304
 
-  std::vector<double> xAxis = ws->readX(0);
+  const auto &xAxis = ws->x(0);
   const size_t sz = xAxis.size() - 1;
   const size_t totalCols = sz;
 
@@ -49,10 +48,9 @@ RefMatrixWSImageView::RefMatrixWSImageView(QString wpsName, int peakMin,
 
   std::vector<float> data(static_cast<size_t>(totalYMax) * sz);
 
-  std::vector<double> yAxis;
   for (size_t px = 0; px < totalYMax; px++) {
     // Retrieve data now
-    yAxis = ws->readY(px);
+    const auto &yAxis = ws->y(px);
     for (size_t tof = 0; tof < sz; tof++)
       data[px * sz + tof] = static_cast<float>(yAxis[tof]);
   }
diff --git a/MantidQt/SliceViewer/src/SliceViewer.cpp b/MantidQt/SliceViewer/src/SliceViewer.cpp
index 6abc16379a41b1f07c8bd4fd311dc0ad65d704a8..b495dceb5de52b412e594fc40f4a8ac772e1e114 100644
--- a/MantidQt/SliceViewer/src/SliceViewer.cpp
+++ b/MantidQt/SliceViewer/src/SliceViewer.cpp
@@ -1299,6 +1299,10 @@ QPixmap SliceViewer::getImage() {
   // Hide the line overlay handles
   this->m_lineOverlay->setShowHandles(false);
   this->m_colorBar->setRenderMode(true);
+  auto previousStyle = ui.frmPlot->styleSheet();
+  ui.frmPlot->setStyleSheet("background-color: white;");
+  this->m_colorBar->setCheckBoxMode(
+      MantidWidgets::ColorBarWidget::ADD_AUTOSCALE_NONE);
 
   // Grab it
   QCoreApplication::processEvents();
@@ -1309,7 +1313,9 @@ QPixmap SliceViewer::getImage() {
   this->m_lineOverlay->setShowHandles(true);
   this->m_colorBar->setRenderMode(false);
   this->setFastRender(oldFast);
-
+  this->m_colorBar->setCheckBoxMode(
+      MantidWidgets::ColorBarWidget::ADD_AUTOSCALE_BOTH);
+  ui.frmPlot->setStyleSheet(previousStyle);
   return pix;
 }
 
@@ -2948,7 +2954,7 @@ void SliceViewer::switchAxis() {
   if (m_canSwitchScales) { // cannot be called when sliceviewer first
                            // initialised because axis is inaccurate
     auto isHKL = API::isHKLDimensions(m_ws, m_dimX, m_dimY);
-    if (isHKL) {
+    if (isHKL && ui.btnNonOrthogonalToggle->isChecked()) {
       applyNonOrthogonalAxisScaleDraw();
     } else {
       applyOrthogonalAxisScaleDraw();
diff --git a/Testing/SystemTests/tests/analysis/BASISAutoReduction.py b/Testing/SystemTests/tests/analysis/BASISAutoReduction.py
index 512d8914656cef18af2132b451eb09892034b460..960c43836259e34185ab311966c35eaae8595d64 100644
--- a/Testing/SystemTests/tests/analysis/BASISAutoReduction.py
+++ b/Testing/SystemTests/tests/analysis/BASISAutoReduction.py
@@ -1,4 +1,4 @@
-#pylint: disable=no-init,attribute-defined-outside-init
+#pylint: disable=no-init,attribute-defined-outside-init
 """
 System Test for BASIS autoreduction
 """
diff --git a/Testing/SystemTests/tests/analysis/ILLIndirectReductionQENS.py b/Testing/SystemTests/tests/analysis/ILLIndirectReductionQENS.py
index 0e627e8ff8d7da94c9550f1c08e1f1d39d08e59a..112f82b579b81064913efc5a6f1baea508ee0e09 100644
--- a/Testing/SystemTests/tests/analysis/ILLIndirectReductionQENS.py
+++ b/Testing/SystemTests/tests/analysis/ILLIndirectReductionQENS.py
@@ -1,7 +1,6 @@
 import stresstesting
 from mantid.simpleapi import *
 from mantid import config
-from testhelpers import run_algorithm
 
 
 class ILLIndirectReductionQENSTest(stresstesting.MantidStressTest):
@@ -40,33 +39,25 @@ class ILLIndirectReductionQENSTest(stresstesting.MantidStressTest):
                 'UnmirrorOption' : 0,
                 'OutputWorkspace' : 'zero'}
 
-        alg_test = run_algorithm('IndirectILLReductionQENS', **args)
-
-        self.assertTrue(alg_test.isExecuted(), "IndirectILLReductionQENS not executed for unmirror 0")
+        IndirectILLReductionQENS(**args)
 
         args['UnmirrorOption'] = 1
 
         args['OutputWorkspace'] = 'both'
 
-        alg_test = run_algorithm('IndirectILLReductionQENS', **args)
-
-        self.assertTrue(alg_test.isExecuted(), "IndirectILLReductionQENS not executed for unmirror 1")
+        IndirectILLReductionQENS(**args)
 
         args['UnmirrorOption'] = 2
 
         args['OutputWorkspace'] = 'left'
 
-        alg_test = run_algorithm('IndirectILLReductionQENS', **args)
-
-        self.assertTrue(alg_test.isExecuted(), "IndirectILLReductionQENS not executed for unmirror 2")
+        IndirectILLReductionQENS(**args)
 
         args['UnmirrorOption'] = 3
 
         args['OutputWorkspace'] = 'right'
 
-        alg_test = run_algorithm('IndirectILLReductionQENS', **args)
-
-        self.assertTrue(alg_test.isExecuted(), "IndirectILLReductionQENS not executed for unmirror 3")
+        IndirectILLReductionQENS(**args)
 
         summed = Plus(mtd['left_red'].getItem(0),mtd['right_red'].getItem(0))
 
@@ -88,9 +79,7 @@ class ILLIndirectReductionQENSTest(stresstesting.MantidStressTest):
                 'UnmirrorOption': 4,
                 'OutputWorkspace': 'vana4'}
 
-        alg_test = run_algorithm('IndirectILLReductionQENS', **args)
-
-        self.assertTrue(alg_test.isExecuted(), "IndirectILLReductionQENS not executed for unmirror 4")
+        IndirectILLReductionQENS(**args)
 
         args['AlignmentRun'] = '136553.nxs'
 
@@ -98,9 +87,7 @@ class ILLIndirectReductionQENSTest(stresstesting.MantidStressTest):
 
         args['OutputWorkspace'] = 'vana5'
 
-        alg_test = run_algorithm('IndirectILLReductionQENS', **args)
-
-        self.assertTrue(alg_test.isExecuted(), "IndirectILLReductionQENS not executed for unmirror 5")
+        IndirectILLReductionQENS(**args)
 
         result = CompareWorkspaces('vana4_red', 'vana5_red')
 
@@ -113,9 +100,7 @@ class ILLIndirectReductionQENSTest(stresstesting.MantidStressTest):
                 'UnmirrorOption': 6,
                 'OutputWorkspace': 'vana6'}
 
-        alg_test = run_algorithm('IndirectILLReductionQENS', **args)
-
-        self.assertTrue(alg_test.isExecuted(), "IndirectILLReductionQENS not executed for unmirror 6")
+        IndirectILLReductionQENS(**args)
 
         args['AlignmentRun'] = '136553.nxs'
 
@@ -123,9 +108,7 @@ class ILLIndirectReductionQENSTest(stresstesting.MantidStressTest):
 
         args['OutputWorkspace'] = 'vana7'
 
-        alg_test = run_algorithm('IndirectILLReductionQENS', **args)
-
-        self.assertTrue(alg_test.isExecuted(), "IndirectILLReductionQENS not executed for unmirror 7")
+        IndirectILLReductionQENS(**args)
 
         result = CompareWorkspaces('vana6_red','vana7_red')
 
diff --git a/Testing/SystemTests/tests/analysis/ISISDirectInelastic.py b/Testing/SystemTests/tests/analysis/ISISDirectInelastic.py
index af33267c34c01e41e2f543409592579e2e712892..be3b522cb919f0106534f85b2e880df7fc80c6c1 100644
--- a/Testing/SystemTests/tests/analysis/ISISDirectInelastic.py
+++ b/Testing/SystemTests/tests/analysis/ISISDirectInelastic.py
@@ -1,4 +1,4 @@
-#pylint: disable=no-init
+#pylint: disable=no-init
 import stresstesting
 from mantid.simpleapi import *
 from mantid.api import Workspace
diff --git a/Testing/SystemTests/tests/analysis/ISISDirectReductionComponents.py b/Testing/SystemTests/tests/analysis/ISISDirectReductionComponents.py
index 2803fd76b482632523a48cf4ad275a60152077d4..de92eb1094d7588bef30721ee164bfbc43e17e52 100644
--- a/Testing/SystemTests/tests/analysis/ISISDirectReductionComponents.py
+++ b/Testing/SystemTests/tests/analysis/ISISDirectReductionComponents.py
@@ -1,4 +1,4 @@
-#pylint: disable=invalid-name
+#pylint: disable=invalid-name
 import os
 import sys
 import stresstesting
diff --git a/Testing/SystemTests/tests/analysis/ISISPowderDiffractionGemTest.py b/Testing/SystemTests/tests/analysis/ISISPowderDiffractionGemTest.py
index 871efe70632dd27ac517cc052089bf1fa354abd6..8f1f41fb392a4a813ce546e78e74b34389bcb233 100644
--- a/Testing/SystemTests/tests/analysis/ISISPowderDiffractionGemTest.py
+++ b/Testing/SystemTests/tests/analysis/ISISPowderDiffractionGemTest.py
@@ -1,4 +1,4 @@
-# pylint: disable=no-init,attribute-defined-outside-init,too-many-public-methods
+# pylint: disable=no-init,attribute-defined-outside-init,too-many-public-methods
 
 from mantid.api import AnalysisDataService, MatrixWorkspace, WorkspaceGroup, \
     ITableWorkspace
diff --git a/Testing/SystemTests/tests/analysis/ISISPowderDiffractionHrpdTest.py b/Testing/SystemTests/tests/analysis/ISISPowderDiffractionHrpdTest.py
index bca8e6c8998bd0df22a840d6910bb4571d1d79e0..839e3352b8ad8b6a040b96986371eb9443d1bfc7 100644
--- a/Testing/SystemTests/tests/analysis/ISISPowderDiffractionHrpdTest.py
+++ b/Testing/SystemTests/tests/analysis/ISISPowderDiffractionHrpdTest.py
@@ -1,4 +1,4 @@
-# pylint: disable=no-init,attribute-defined-outside-init,too-few-public-methods,too-many-public-methods
+# pylint: disable=no-init,attribute-defined-outside-init,too-few-public-methods,too-many-public-methods
 
 from mantid.api import AnalysisDataService, MatrixWorkspace, WorkspaceGroup
 from mantid.simpleapi import *
diff --git a/Testing/SystemTests/tests/analysis/ISISPowderDiffractionPolarisTest.py b/Testing/SystemTests/tests/analysis/ISISPowderDiffractionPolarisTest.py
index 29c0fa1f7006e53d96ec03465cd1860710ee7e35..ee9178f125853691b9d3d3c6581a83e2e095f02b 100644
--- a/Testing/SystemTests/tests/analysis/ISISPowderDiffractionPolarisTest.py
+++ b/Testing/SystemTests/tests/analysis/ISISPowderDiffractionPolarisTest.py
@@ -1,4 +1,4 @@
-# pylint: disable=no-init,attribute-defined-outside-init,too-many-public-methods
+# pylint: disable=no-init,attribute-defined-outside-init,too-many-public-methods
 
 from mantid.api import AnalysisDataService, MatrixWorkspace, WorkspaceGroup, \
     ITableWorkspace
diff --git a/Testing/SystemTests/tests/analysis/ISIS_LETReduction.py b/Testing/SystemTests/tests/analysis/ISIS_LETReduction.py
index 2618f1e630fc52cc023b39b8a5756e407ddc30a5..888eb4e2b89b6ab31f49875837e16f6c9be3b349 100644
--- a/Testing/SystemTests/tests/analysis/ISIS_LETReduction.py
+++ b/Testing/SystemTests/tests/analysis/ISIS_LETReduction.py
@@ -1,4 +1,4 @@
-#pylint: disable=invalid-name
+#pylint: disable=invalid-name
 """ Sample LET reduction script """
 
 from Direct.ReductionWrapper import *
diff --git a/Testing/SystemTests/tests/analysis/ISIS_MERLINReduction.py b/Testing/SystemTests/tests/analysis/ISIS_MERLINReduction.py
index 9f77facae776692b25f0fb8159d5185b9e4ea02b..2d8e2e4a31586389f59205fbbe74b94cc847b15e 100644
--- a/Testing/SystemTests/tests/analysis/ISIS_MERLINReduction.py
+++ b/Testing/SystemTests/tests/analysis/ISIS_MERLINReduction.py
@@ -1,4 +1,4 @@
-#pylint: disable=invalid-name
+#pylint: disable=invalid-name
 """ Sample MERLIN reduction scrip """
 from Direct.ReductionWrapper import *
 try:
diff --git a/Testing/SystemTests/tests/analysis/ISIS_MariReduction.py b/Testing/SystemTests/tests/analysis/ISIS_MariReduction.py
index 99dc21786c357978b0bcee51a629a599aeb3ecaa..5d580fb6a09120c216d35b6129bd7e4c197bb0bc 100644
--- a/Testing/SystemTests/tests/analysis/ISIS_MariReduction.py
+++ b/Testing/SystemTests/tests/analysis/ISIS_MariReduction.py
@@ -1,4 +1,4 @@
-#pylint: disable=invalid-name
+#pylint: disable=invalid-name
 """ Sample MARI reduction scrip used in testing ReductionWrapper """
 import os
 #
diff --git a/Testing/SystemTests/tests/analysis/LOQAddBatch.py b/Testing/SystemTests/tests/analysis/LOQAddBatch.py
index 972e810526f6bcd6f88cbbc116cf0f642b062dc0..dc64550c595c65bc162d888759fcb0490af89141 100644
--- a/Testing/SystemTests/tests/analysis/LOQAddBatch.py
+++ b/Testing/SystemTests/tests/analysis/LOQAddBatch.py
@@ -1,4 +1,5 @@
 #pylint: disable=no-init,invalid-name,attribute-defined-outside-init
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 from mantid.api import FileFinder
@@ -16,7 +17,7 @@ class SANSAddBatch(stresstesting.MantidStressTest):
     result = ''
 
     def cleanup(self):
-        print "Cleanup"
+        print("Cleanup")
         absfile = FileFinder.getFullPath("input.csv")
         if os.path.exists(absfile):
             os.remove(absfile)
@@ -31,7 +32,7 @@ class SANSAddBatch(stresstesting.MantidStressTest):
     # Find the file , this should really be in the BatchReduce reduction step
 
         f = open(self.csv_file,'w')
-        print >> f, "sample_sans,99630-add,output_as, %s"%self.output_file
+        print("sample_sans,99630-add,output_as, %s"%self.output_file, file=f)
         f.close()
         runnum = '99630'
         sansadd.add_runs((runnum, runnum),'LOQ','.RAW')
@@ -40,7 +41,7 @@ class SANSAddBatch(stresstesting.MantidStressTest):
         ici.MaskFile('MASK.094AA')
         batch.BatchReduce(self.csv_file, 'nxs', plotresults=False, saveAlgs={'SaveNexus':'nxs'})
 
-        print ' reduction without'
+        print(' reduction without')
 
         ici._refresh_singleton()
 
@@ -61,7 +62,7 @@ class SANSAddBatch(stresstesting.MantidStressTest):
         self.disableChecking.append('Axes')
         self.disableChecking.append('Instrument')
         self.tolerance = 1.0e-10 #almost ZERO!
-        print 'validating', self.result, self.output_file
+        print('validating', self.result, self.output_file)
         return self.result,self.output_file+'.nxs'
 
     def __del__(self):
diff --git a/Testing/SystemTests/tests/analysis/LOQCentreNoGrav.py b/Testing/SystemTests/tests/analysis/LOQCentreNoGrav.py
index 13632295a3c21581729e57af8aa2f630d0bd5682..11a0b80933be4941909c30e2b092f099160cd14c 100644
--- a/Testing/SystemTests/tests/analysis/LOQCentreNoGrav.py
+++ b/Testing/SystemTests/tests/analysis/LOQCentreNoGrav.py
@@ -1,4 +1,5 @@
-#pylint: disable=no-init
+#pylint: disable=no-init
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 from ISISCommandInterface import *
diff --git a/Testing/SystemTests/tests/analysis/LOQReductionGUI.py b/Testing/SystemTests/tests/analysis/LOQReductionGUI.py
index 3c0c489eafc574ba237b02b56eb5336984f15af1..ff8ec7e19c48d2adeb8f6f6e6a1ffe5f4cb01244 100644
--- a/Testing/SystemTests/tests/analysis/LOQReductionGUI.py
+++ b/Testing/SystemTests/tests/analysis/LOQReductionGUI.py
@@ -1,4 +1,6 @@
 #pylint: disable=attribute-defined-outside-init
+
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 import ISISCommandInterface as i
diff --git a/Testing/SystemTests/tests/analysis/LOQSANSUtilityTest.py b/Testing/SystemTests/tests/analysis/LOQSANSUtilityTest.py
index f6e3add31136683a2461da330a233af8588ebef6..edf61ccf28e6ccd20ad9110ae94759d4b5406df5 100644
--- a/Testing/SystemTests/tests/analysis/LOQSANSUtilityTest.py
+++ b/Testing/SystemTests/tests/analysis/LOQSANSUtilityTest.py
@@ -1,4 +1,6 @@
 #pylint: disable=invalid-name,no-init,too-few-public-methods
+
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 import SANSUtility as su
diff --git a/Testing/SystemTests/tests/analysis/LOQTransFitWorkspace2D.py b/Testing/SystemTests/tests/analysis/LOQTransFitWorkspace2D.py
index 376c8dd77fba11b381e2cd12c30ac04927e4f099..dd845beff7dde389f6b9e0a78870ad734746b781 100644
--- a/Testing/SystemTests/tests/analysis/LOQTransFitWorkspace2D.py
+++ b/Testing/SystemTests/tests/analysis/LOQTransFitWorkspace2D.py
@@ -1,4 +1,6 @@
 #pylint: disable=no-init
+
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 from ISISCommandInterface import *
diff --git a/Testing/SystemTests/tests/analysis/LoadLotsOfFiles.py b/Testing/SystemTests/tests/analysis/LoadLotsOfFiles.py
index 20c25522681c65abc590cef2887c4507de81ca50..28bca44cd1d6cc7df197b198676f82d970163ab9 100644
--- a/Testing/SystemTests/tests/analysis/LoadLotsOfFiles.py
+++ b/Testing/SystemTests/tests/analysis/LoadLotsOfFiles.py
@@ -1,4 +1,4 @@
-#pylint: disable=invalid-name,no-init
+#pylint: disable=invalid-name,no-init
 from mantid.simpleapi import *
 from mantid.api import FrameworkManager
 import copy
diff --git a/Testing/SystemTests/tests/analysis/MaxEntTest.py b/Testing/SystemTests/tests/analysis/MaxEntTest.py
index 29a31690951cfa742f2361c0a5f31295c9169787..738e555799971070f0361a5bf76cc58da94776d7 100644
--- a/Testing/SystemTests/tests/analysis/MaxEntTest.py
+++ b/Testing/SystemTests/tests/analysis/MaxEntTest.py
@@ -1,4 +1,4 @@
-#pylint: disable=no-init,attribute-defined-outside-init
+#pylint: disable=no-init,attribute-defined-outside-init
 import stresstesting
 from mantid.simpleapi import *
 
diff --git a/Testing/SystemTests/tests/analysis/MuonFFTTest.py b/Testing/SystemTests/tests/analysis/MuonFFTTest.py
index 8ffac444e64e4dfd3a2d10d39bf3be751949814f..69d791fbba997bce0f1ae26f01799be51cf30bc7 100644
--- a/Testing/SystemTests/tests/analysis/MuonFFTTest.py
+++ b/Testing/SystemTests/tests/analysis/MuonFFTTest.py
@@ -1,4 +1,4 @@
-#pylint: disable=no-init,attribute-defined-outside-init
+#pylint: disable=no-init,attribute-defined-outside-init
 import stresstesting
 from mantid.simpleapi import *
 from math import pi
diff --git a/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAuto.py b/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAuto.py
index 7698184cbdbb3952aedcd428a126c9d8b2ea679c..f61dc4634f95d9e9c7c45bbc92b1cf19a361fda8 100644
--- a/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAuto.py
+++ b/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAuto.py
@@ -1,4 +1,4 @@
-# pylint: disable=no-init,invalid-name,attribute-defined-outside-init
+# pylint: disable=no-init,invalid-name,attribute-defined-outside-init
 """
 This system test verifies that OFFSPEC data is processed correctly by
 ReflectometryReductionOneAuto
diff --git a/Testing/SystemTests/tests/analysis/SANS2DBatch.py b/Testing/SystemTests/tests/analysis/SANS2DBatch.py
index b4cfda4a413e6c716507d252f096990f2db90880..1c98adc868bf09291e944461519f31e949eab129 100644
--- a/Testing/SystemTests/tests/analysis/SANS2DBatch.py
+++ b/Testing/SystemTests/tests/analysis/SANS2DBatch.py
@@ -1,6 +1,7 @@
 #pylint: disable=no-init,attribute-defined-outside-init
-import stresstesting
 
+from __future__ import (absolute_import, division, print_function)
+import stresstesting
 from mantid.simpleapi import *
 from ISISCommandInterface import *
 from mantid import config
diff --git a/Testing/SystemTests/tests/analysis/SANS2DFrontNoGrav.py b/Testing/SystemTests/tests/analysis/SANS2DFrontNoGrav.py
index b2901aeb3f7f797e304c6966a89f89c57966b12f..e9b4fa839bc22d8370436b8aeb954b332123427c 100644
--- a/Testing/SystemTests/tests/analysis/SANS2DFrontNoGrav.py
+++ b/Testing/SystemTests/tests/analysis/SANS2DFrontNoGrav.py
@@ -1,4 +1,6 @@
 #pylint: disable=no-init
+
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 from ISISCommandInterface import *
diff --git a/Testing/SystemTests/tests/analysis/SANS2DLOQReloadWorkspaces.py b/Testing/SystemTests/tests/analysis/SANS2DLOQReloadWorkspaces.py
index 4e15b7071cefad54eef309fcb63e954729521705..65ddfca395e2f97642496ca47c6bd42e0d64e332 100644
--- a/Testing/SystemTests/tests/analysis/SANS2DLOQReloadWorkspaces.py
+++ b/Testing/SystemTests/tests/analysis/SANS2DLOQReloadWorkspaces.py
@@ -1,4 +1,5 @@
-#pylint: disable=invalid-name,no-init
+#pylint: disable=invalid-name,no-init
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 from ISISCommandInterface import *
diff --git a/Testing/SystemTests/tests/analysis/SANS2DLimitEventsTime.py b/Testing/SystemTests/tests/analysis/SANS2DLimitEventsTime.py
index 76d389cc13590b71f86e90b9b8fc0177d53b9c29..f41ec54c4847ff7320f17b48cb3366165da461a4 100644
--- a/Testing/SystemTests/tests/analysis/SANS2DLimitEventsTime.py
+++ b/Testing/SystemTests/tests/analysis/SANS2DLimitEventsTime.py
@@ -1,4 +1,6 @@
 #pylint: disable=no-init
+
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 from ISISCommandInterface import *
diff --git a/Testing/SystemTests/tests/analysis/SANS2DMultiPeriod.py b/Testing/SystemTests/tests/analysis/SANS2DMultiPeriod.py
index edd9e11fa59d8525e74fb9fe5272087526a2ce8f..3bafaf807bc873f1ed42000674cdbc582a5d2b14 100644
--- a/Testing/SystemTests/tests/analysis/SANS2DMultiPeriod.py
+++ b/Testing/SystemTests/tests/analysis/SANS2DMultiPeriod.py
@@ -1,4 +1,6 @@
 #pylint: disable=no-init,too-few-public-methods
+
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 
 from mantid.api import AnalysisDataService
@@ -96,8 +98,6 @@ class LARMORMultiPeriodEventModeLoading(stresstesting.MantidStressTest):
         number_of_workspaces = 4
         self._check_if_all_multi_period_workspaces_have_the_same_position(base_name, number_of_workspaces)
         self._clean_up(base_name, number_of_workspaces)
-        for element in mtd.getObjectNames():
-            print element
 
     def validate(self):
         return self.success
diff --git a/Testing/SystemTests/tests/analysis/SANS2DMultiPeriodAddFiles.py b/Testing/SystemTests/tests/analysis/SANS2DMultiPeriodAddFiles.py
index 4ffa4e0d87aa9d374f29930390d060cba4e8a1ef..6127748f5ec702a5d99e8c710c1cc1f1e25007e1 100644
--- a/Testing/SystemTests/tests/analysis/SANS2DMultiPeriodAddFiles.py
+++ b/Testing/SystemTests/tests/analysis/SANS2DMultiPeriodAddFiles.py
@@ -1,4 +1,5 @@
-#pylint: disable=no-init
+#pylint: disable=no-init
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 
diff --git a/Testing/SystemTests/tests/analysis/SANS2DReductionGUI.py b/Testing/SystemTests/tests/analysis/SANS2DReductionGUI.py
index 5a76d8cab1dafcd94193e2039918a8d1c1960dda..fe3e3ac1f01ce0b777b994002b8391cbbdae2891 100644
--- a/Testing/SystemTests/tests/analysis/SANS2DReductionGUI.py
+++ b/Testing/SystemTests/tests/analysis/SANS2DReductionGUI.py
@@ -13,6 +13,7 @@ The first 2 Tests ensures that the result provided by the GUI are the same for t
 Test was first created to apply to Mantid Release 3.0.
 """
 
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 import isis_reducer
@@ -26,7 +27,7 @@ BATCHFILE = FileFinder.getFullPath('sans2d_reduction_gui_batch.csv')
 
 
 def s(obj):
-    print '!'+str(obj)+'!',type(obj)
+    print('!'+str(obj)+'!',type(obj))
 
 
 class SANS2DMinimalBatchReduction(stresstesting.MantidStressTest):
diff --git a/Testing/SystemTests/tests/analysis/SANS2DReductionGUIAdded.py b/Testing/SystemTests/tests/analysis/SANS2DReductionGUIAdded.py
index c94f1aa7064287617b81cd83e2e74443fed05169..5cbe465503167af292b1daeffdc9e8b3cdcecfec 100644
--- a/Testing/SystemTests/tests/analysis/SANS2DReductionGUIAdded.py
+++ b/Testing/SystemTests/tests/analysis/SANS2DReductionGUIAdded.py
@@ -1,4 +1,6 @@
 #pylint: disable=invalid-name
+
+from __future__ import (absolute_import, division, print_function)
 from mantid.simpleapi import *
 import ISISCommandInterface as i
 import copy
diff --git a/Testing/SystemTests/tests/analysis/SANS2DSearchCentreGUI.py b/Testing/SystemTests/tests/analysis/SANS2DSearchCentreGUI.py
index de2beb771d143bab20cca7e0f4bcb92830bf6167..79d95a0396717053e4cbbfb807272a852f244065 100644
--- a/Testing/SystemTests/tests/analysis/SANS2DSearchCentreGUI.py
+++ b/Testing/SystemTests/tests/analysis/SANS2DSearchCentreGUI.py
@@ -1,5 +1,7 @@
 #pylint: disable=invalid-name
-import mantid
+
+from __future__ import (absolute_import, division, print_function)
+import mantid  # noqa
 import ISISCommandInterface as i
 import isis_reducer
 import isis_instrument
diff --git a/Testing/SystemTests/tests/analysis/SANS2DSlicing.py b/Testing/SystemTests/tests/analysis/SANS2DSlicing.py
index 0b78a2ce374744f21aceb3bd4cc9bf6176503777..3ef7d50f215c8fe22628fe4e345fe75dfec99aa4 100644
--- a/Testing/SystemTests/tests/analysis/SANS2DSlicing.py
+++ b/Testing/SystemTests/tests/analysis/SANS2DSlicing.py
@@ -1,5 +1,6 @@
 #pylint: disable=invalid-name,attribute-defined-outside-init
 
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 
 from mantid.simpleapi import *
diff --git a/Testing/SystemTests/tests/analysis/SANS2DWaveloops.py b/Testing/SystemTests/tests/analysis/SANS2DWaveloops.py
index 6a040e05828c69b10c56e64b8cb4038d0351ebee..d9f2cf536560d652a1992c105beac2f78e77f115 100644
--- a/Testing/SystemTests/tests/analysis/SANS2DWaveloops.py
+++ b/Testing/SystemTests/tests/analysis/SANS2DWaveloops.py
@@ -1,4 +1,6 @@
 #pylint: disable=no-init
+
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 from ISISCommandInterface import *
diff --git a/Testing/SystemTests/tests/analysis/SANSCentreSample.py b/Testing/SystemTests/tests/analysis/SANSCentreSample.py
index b75026715357bc68d5ee19bb61061a04667a4b6e..9e1aebedb960809af1bafead190b14c1065df6f4 100644
--- a/Testing/SystemTests/tests/analysis/SANSCentreSample.py
+++ b/Testing/SystemTests/tests/analysis/SANSCentreSample.py
@@ -1,4 +1,6 @@
 #pylint: disable=no-init
+
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 from ISISCommandInterface import *
diff --git a/Testing/SystemTests/tests/analysis/SANSDarkRunSubtractionTest.py b/Testing/SystemTests/tests/analysis/SANSDarkRunSubtractionTest.py
index 0f824ccc8ac4a18b3f8881ce3948d3a11aaf7602..f35c09ad941f992381983c63e2a4d1cd6d27967e 100644
--- a/Testing/SystemTests/tests/analysis/SANSDarkRunSubtractionTest.py
+++ b/Testing/SystemTests/tests/analysis/SANSDarkRunSubtractionTest.py
@@ -1,7 +1,8 @@
-#pylint: disable=no-init
+#pylint: disable=no-init
 #pylint: disable=invalid-name
 #pylint: disable=too-many-arguments
 #pylint: disable=too-many-public-methods
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import stresstesting
 from mantid.simpleapi import *
@@ -328,7 +329,7 @@ class DarkRunSubtractionTest(unittest.TestCase):
 
         monitor_ids = [1,2,3,4]
         trans_ids = monitor_ids
-        detector_ids = range(1100000, 1100010)
+        detector_ids = list(range(1100000, 1100010))
         trans_ids.extend(detector_ids)
 
         # Act + Assert
@@ -350,7 +351,7 @@ class DarkRunSubtractionTest(unittest.TestCase):
             self.assertFalse(np.greater(y, 1e-14).any(), "Monitor2 entries should be 0")
 
         # Detectors should be set to 0
-        detector_indices = range(4,14)
+        detector_indices = list(range(4,14))
         for i in detector_indices:
             y = transmission_workspace.dataY(i)
             self.assertFalse(np.greater(y, 1e-14).any(), "All detectors entries should be 0")
@@ -370,7 +371,7 @@ class DarkRunSubtractionTest(unittest.TestCase):
 
         monitor_ids = [1,2,3,4]
         trans_ids = monitor_ids
-        detector_ids = range(1100000, 1100010)
+        detector_ids = list(range(1100000, 1100010))
         trans_ids.extend(detector_ids)
 
         # Act + Assert
diff --git a/Testing/SystemTests/tests/analysis/SANSFileChecking.py b/Testing/SystemTests/tests/analysis/SANSFileChecking.py
index 17cc40369d28c2c2ab01a5fa4c10c83100687a50..6e35a0aed2576c37d1ac27d94bd5da9b8fe062b5 100644
--- a/Testing/SystemTests/tests/analysis/SANSFileChecking.py
+++ b/Testing/SystemTests/tests/analysis/SANSFileChecking.py
@@ -1,9 +1,10 @@
-#pylint: disable=invalid-name,no-init
+#pylint: disable=invalid-name,no-init
 #pylint: disable=too-many-public-methods
 """
 Check that file manipulation works fine
 """
 
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import stresstesting
 from mantid.simpleapi import *
@@ -40,7 +41,7 @@ class SANSFileCheckingTest(unittest.TestCase):
             measurement_time = su.get_measurement_time_from_file(full_path)
             self.assertEqual(measurement_time, expected_time)
         else:
-            print "Missing data files. Path to system test data needs to be set."
+            print("Missing data files. Path to system test data needs to be set.")
             self.assertTrue(False)
 
     def test_that_sans2D_nexus_file_with_date_is_evaluated_correctly(self):
@@ -88,7 +89,7 @@ class SANSMatchIDFInReducerAndWorkspaceTest(unittest.TestCase):
             measurement_time = su.get_measurement_time_from_file(full_path)
             idf_path_workspace = ExperimentInfo.getInstrumentFilename(instrument_name, measurement_time)
         else:
-            print "Missing data files. Path to system test data needs to be set."
+            print("Missing data files. Path to system test data needs to be set.")
             self.assertTrue(False)
         return idf_path_workspace
 
diff --git a/Testing/SystemTests/tests/analysis/SANSLOQBatch.py b/Testing/SystemTests/tests/analysis/SANSLOQBatch.py
index 9acaf5c2f4d86b53bd90137a130df318f6d9f025..21f4a26d35ad9e0d07cd66c54bedb4ab8b2b45bc 100644
--- a/Testing/SystemTests/tests/analysis/SANSLOQBatch.py
+++ b/Testing/SystemTests/tests/analysis/SANSLOQBatch.py
@@ -1,4 +1,6 @@
 #pylint: disable=no-init
+
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 from mantid import config
diff --git a/Testing/SystemTests/tests/analysis/SANSLOQCan2D.py b/Testing/SystemTests/tests/analysis/SANSLOQCan2D.py
index e4b5c2d3f1c0c8186c5ba965cbf5c17bdd012e24..a9922090b0852531dc47e53b2942e32860aceae3 100644
--- a/Testing/SystemTests/tests/analysis/SANSLOQCan2D.py
+++ b/Testing/SystemTests/tests/analysis/SANSLOQCan2D.py
@@ -1,4 +1,6 @@
 #pylint: disable=no-init
+
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 from ISISCommandInterface import *
diff --git a/Testing/SystemTests/tests/analysis/SANSLoadersTest.py b/Testing/SystemTests/tests/analysis/SANSLoadersTest.py
index e0a63a6ae41a036214a6d59412854e011d8a2d26..e414234fdf37cff3ed126f94752febfe8e1c8893 100644
--- a/Testing/SystemTests/tests/analysis/SANSLoadersTest.py
+++ b/Testing/SystemTests/tests/analysis/SANSLoadersTest.py
@@ -1,10 +1,11 @@
-#pylint: disable=invalid-name,no-init
+#pylint: disable=invalid-name,no-init
 """
 Check the loaders of ISIS SANS reduction. It is created as systemtest because it does
 take considerable time because it involves loading data. Besides, it uses data that is
 currently available inside the systemtests.
 """
 
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import stresstesting
 from mantid.simpleapi import *
@@ -131,7 +132,7 @@ class LoadSampleTest(unittest.TestCase):
         loadSample = steps.LoadSample('5512')
         loadSample.execute(ici.ReductionSingleton(), True)
         self.assertEqual(loadSample.wksp_name, '5512_sans_nxs_1')
-        self.assertEqual(loadSample.entries, range(0,13))
+        self.assertEqual(loadSample.entries, list(range(0,13)))
         for index in [0,5,12]:
             loadSample.move2ws(index)
             self.assertEqual(loadSample.wksp_name, '5512_sans_nxs_'+str(index+1))
@@ -219,7 +220,7 @@ class LoadAddedEventDataSampleTestStressTest(stresstesting.MantidStressTest):
 
                 if not self.validateWorkspaces(valPair,mismatchName):
                     validationResult[index/2] = False
-                    print 'Workspace {0} not equal to its reference file'.format(valNames[ik])
+                    print('Workspace {0} not equal to its reference file'.format(valNames[ik]))
             #end check All results
 
         # Check if a comparison went wrong
diff --git a/Testing/SystemTests/tests/analysis/SANSMergedDetectorsTest.py b/Testing/SystemTests/tests/analysis/SANSMergedDetectorsTest.py
index 68adb44aa01ec0cad2ce22677042b5c386eab7d9..3e22d501d9408399c99a118b4ce4e0ee563408f1 100644
--- a/Testing/SystemTests/tests/analysis/SANSMergedDetectorsTest.py
+++ b/Testing/SystemTests/tests/analysis/SANSMergedDetectorsTest.py
@@ -1,5 +1,6 @@
-#pylint: disable=invalid-name
+#pylint: disable=invalid-name
 
+from __future__ import (absolute_import, division, print_function)
 from mantid.simpleapi import *
 import ISISCommandInterface as i
 import stresstesting
diff --git a/Testing/SystemTests/tests/analysis/SANSQResolutionTest.py b/Testing/SystemTests/tests/analysis/SANSQResolutionTest.py
index bfb5d1b240dc56552538f9df25d4fe501f547625..77ad74eaf5d81e206274fc934fc2dd21be7ead06 100644
--- a/Testing/SystemTests/tests/analysis/SANSQResolutionTest.py
+++ b/Testing/SystemTests/tests/analysis/SANSQResolutionTest.py
@@ -1,4 +1,6 @@
 #pylint: disable=no-init
+
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 from ISISCommandInterface import *
diff --git a/Testing/SystemTests/tests/analysis/SANSWorkspaceTypeTest.py b/Testing/SystemTests/tests/analysis/SANSWorkspaceTypeTest.py
index 53a8a428eca473f65890a64637bf60646604d5ec..138219ca0e7eecb9419fcfc32e21c8c1448ef25f 100644
--- a/Testing/SystemTests/tests/analysis/SANSWorkspaceTypeTest.py
+++ b/Testing/SystemTests/tests/analysis/SANSWorkspaceTypeTest.py
@@ -1,4 +1,5 @@
-#pylint: disable=invalid-name,no-init
+#pylint: disable=invalid-name,no-init
+from __future__ import (absolute_import, division, print_function)
 import stresstesting
 from mantid.simpleapi import *
 from SANSUtility import can_load_as_event_workspace
diff --git a/buildconfig/CMake/VersionNumber.cmake b/buildconfig/CMake/VersionNumber.cmake
index 95b428a5834745dffd7dec1a2dba96d43caf517a..e8075e9ffdd7ef12c132fbe5e1beb8dd4999749d 100644
--- a/buildconfig/CMake/VersionNumber.cmake
+++ b/buildconfig/CMake/VersionNumber.cmake
@@ -6,4 +6,4 @@ set ( VERSION_MINOR 9 )
 # UNCOMMENT the next 'set' line to 'force' the patch version number to
 # a value (instead of using the count coming out of 'git describe')
 # DO NOT COMMIT THIS TO MASTER UNCOMMENTED, ONLY TO A RELEASE BRANCH
-#set ( VERSION_PATCH 1 )
+#set ( VERSION_PATCH 0 )
diff --git a/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst b/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst
index fddd4f74625a64926ac14c0ea199b68c0874139f..202472903d44650849f7c7f15c492cf369205e0f 100644
--- a/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst
+++ b/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst
@@ -18,7 +18,7 @@ and container) and  :math:`A_{c,c}` (scattering and absorption in container).
 This algorithm can be used to apply absorption corrections calculated with
 either the :ref:`algm-CylinderPaalmanPingsCorrection` and
 :ref:`algm-FlatPlatePaalmanPingsCorrection` algorithms as well as the legacy
-indirect calculate correcteions routine, providing that the sample and container
+indirect calculate corrections routine, providing that the sample and container
 are first converted to wavelength and the corrections are interpolated to match
 the sample as demonstrated in the example below.
 
diff --git a/docs/source/algorithms/IndirectAnnulusAbsorption-v2.rst b/docs/source/algorithms/IndirectAnnulusAbsorption-v2.rst
index f54b7a23c3224e944994829a4ede4916b47aa516..77c89e34e5ca352f4a22a95c1bdb1260c3fa4746 100644
--- a/docs/source/algorithms/IndirectAnnulusAbsorption-v2.rst
+++ b/docs/source/algorithms/IndirectAnnulusAbsorption-v2.rst
@@ -11,13 +11,18 @@ Description
 
 Calculates and applies corrections for scattering abs absorption in a annular
 sample for a run on an indirect inelastic instrument, optionally allowing for
-the subtraction or corrections of the container.
+the subtraction or corrections of the container. Uses :ref:`MonteCarloAbsorption <algm-MonteCarloAbsorption>`
+to calculate the corrections.
+
 
 The correction factor workspace is a workspace group containing the correction
 factors in the Paalman and Pings format, note that only :math:`{A_{s,s}}` and
 :math:`A_{c,c}` factors are calculated by this algorithm.
 
+Workflow
+--------
 
+.. diagram:: IndirectAnnulusAbsorption-v2_wkflw.dot
 
 Usage
 -----
diff --git a/docs/source/algorithms/IndirectCylinderAbsorption-v2.rst b/docs/source/algorithms/IndirectCylinderAbsorption-v2.rst
index ff18fa8d3d280ea3582646c8315bae5e55427f19..a32f50957cafdce41e50f6b2613d012901b6c424 100644
--- a/docs/source/algorithms/IndirectCylinderAbsorption-v2.rst
+++ b/docs/source/algorithms/IndirectCylinderAbsorption-v2.rst
@@ -11,12 +11,18 @@ Description
 
 Calculates and applies corrections for scattering and absorption in a
 cylindrical sample for a run on an indirect inelastic instrument, optionally
-allowing for the subtraction or corrections of the container.
+allowing for the subtraction or corrections of the container.  Uses :ref:`MonteCarloAbsorption <algm-MonteCarloAbsorption>`
+to calculate the corrections.
+
 
 The correction factor workspace is a workspace group containing the correction
 factors in the Paalman and Pings format, note that only :math:`{A_{s,s}}` and
 :math:`A_{c,c}` factors are calculated by this algorithm.
 
+Workflow
+--------
+
+.. diagram:: IndirectCylinderAbsorption-v2_wkflw.dot
 
 Usage
 -----
diff --git a/docs/source/algorithms/IndirectFlatPlateAbsorption-v2.rst b/docs/source/algorithms/IndirectFlatPlateAbsorption-v2.rst
index cf97046bb9f2efffded8404a35a5601527f12541..f5cd723fcbaa3e8bf202c3ac183d56a3f4cb7d97 100644
--- a/docs/source/algorithms/IndirectFlatPlateAbsorption-v2.rst
+++ b/docs/source/algorithms/IndirectFlatPlateAbsorption-v2.rst
@@ -11,13 +11,18 @@ Description
 
 Calculates and applies corrections for scattering abs absorption in a flat plate
 sample for a run on an indirect inelastic instrument, optionally allowing for
-the subtraction or corrections of the container.
+the subtraction or corrections of the container. Uses :ref:`MonteCarloAbsorption <algm-MonteCarloAbsorption>`
+to calculate the corrections.
+
 
 The correction factor workspace is a workspace group containing the correction
 factors in the Paalman and Pings format, note that only :math:`{A_{s,s}}` and
 :math:`A_{c,c}` factors are calculated by this algorithm.
 
+Workflow
+--------
 
+.. diagram:: IndirectFlatPlateAbsorption-v2_wkflw.dot
 
 Usage
 -----
diff --git a/docs/source/api/python/techniques/ISISPowder-v1.rst b/docs/source/api/python/techniques/ISISPowder-v1.rst
index 9835aa82f06893641fb1a4bbb432cfee87449d18..2f1f19b8de7cb6a2e453e683ad311e2dba3b12e0 100644
--- a/docs/source/api/python/techniques/ISISPowder-v1.rst
+++ b/docs/source/api/python/techniques/ISISPowder-v1.rst
@@ -86,12 +86,13 @@ common properties to all of them. These include the vanadium and empty run numbe
 offset file and label for those runs. Each format is bespoke to the instrument's
 requirements and is documented as part of the instrument documentation.
 
-The first line in all examples holds the run numbers so is documented here.
-The range of run numbers that this block (a block is the lines starting
-with consistent number of spaces throughout) holds details for. In this case it specifies
-runs 123-130 (inclusive) and runs 135-140 (inclusive) should use the following details.
-Additionally a single range of runs can be unbounded such as `200-` which would match
-runs >= 200. There is several sanity checks in place that ensure there is not multiple
+- The first line in all examples holds the run numbers.
+- This is the range of runs inclusively for example *123-130*
+- If the ending number is not known the range can be left unbounded for example
+  *123-* this would match any runs with a run number greater or equal to 123
+
+
+There is several sanity checks in place that ensure there is not multiple
 unbounded entries and that all other runs specified are not within the unbounded range.
 
 PEARL
diff --git a/docs/source/diagrams/IndirectAnnulusAbsorption-v2_wkflw.dot b/docs/source/diagrams/IndirectAnnulusAbsorption-v2_wkflw.dot
new file mode 100644
index 0000000000000000000000000000000000000000..7d7fb4a285a59478840c95db589745b2edb4df4e
--- /dev/null
+++ b/docs/source/diagrams/IndirectAnnulusAbsorption-v2_wkflw.dot
@@ -0,0 +1,110 @@
+digraph IndirectFlatePlateAbsorption {
+  label="IndirectFlatePlateAbsorption Flowchart"
+  $global_style
+  
+  subgraph params  {
+    $param_style
+    SampleWorkspace1        [label="SampleWorkspace"]
+    SampleWorkspace2        [label="SampleWorkspace"]
+    SampleChemicalFormula
+    SampleDensity
+    SampleHeight
+    SampleInnerRadius
+    SampleOuterRadius
+    SampleAngle
+    BeamHeight
+    BeamWidth
+    Events
+    NumberOfWavelengths
+    AbsWorkspace1           [label="AbsorptionWorkspace"]
+    AbsWorkspace2           [label="AbsorptionWorkspace"]
+    CanAbsorptionWorkspace
+    CanWorkspace1
+    CanWorkspace2
+    CanChemicalFormula
+    CanDensity
+    CanInnerRadius
+    CanOuterRadius
+    OutputWorkspace
+  }
+
+  subgraph algorithms  {
+    $algorithm_style
+    GetEFixed
+    ConvertUnits1           [label="ConvertUnits"]
+    ConvertUnits2           [label="ConvertUnits"]
+    ConvertUnits3           [label="ConvertUnits"]
+    SetBeam
+    SetBeam1                [label="SetBeam"]
+    SetBeam2                [label="SetBeam"]
+    SetSample
+    SetSample1              [label="SetSample"]
+    SetSample2              [label="SetSample"]
+    MonteCarlo
+    MonteCarlo1             [label="MonteCarlo"]
+    MonteCarlo2             [label="MonteCarlo"]
+    Scale
+    Divide
+    Minus
+    AddSampleLogMultiple
+    GroupWorkspaces
+    Multiply
+  }
+  
+  subgraph decisions {
+    $decision_style
+    canGiven          [label="Container Workspace?"]
+    useCorrections    [label="Container Corrections?"]
+  }
+
+SampleWorkspace1                 -> GetEFixed
+GetEFixed                        -> ConvertUnits1                   [label="Convert input workspace to Wavelength"]
+ConvertUnits1                    -> SetBeam
+BeamHeight                       -> SetBeam 
+BeamWidth                        -> SetBeam
+SetBeam                          -> SetSample
+SampleInnerRadius                -> SetSample
+SampleOuterRadius                -> SetSample
+SampleHeight                     -> SetSample
+SampleAngle                      -> SetSample
+SampleChemicalFormula            -> SetSample
+SampleDensity                    -> SetSample
+SetSample                        -> MonteCarlo
+Events                           -> MonteCarlo
+NumberOfWavelengths              -> MonteCarlo
+MonteCarlo                       -> AbsWorkspace1
+MonteCarlo                       -> canGiven
+canGiven                            -> ConvertUnits2                 [label="Yes"]
+  ConvertUnits2                     -> Scale
+  ConvertUnits2                     -> Clone
+  Scale                             -> Clone
+  Clone                             -> Divide1
+  SampleWorkspace2                  -> Divide1
+  AbsWorkspace2                     -> Divide1
+  Divide1                           -> useCorrections
+  useCorrections                    -> CanWorkspace1                 [label="Yes"]
+    CanWorkspace1                       -> SetBeam1
+    SetBeam1                            -> SetSample1
+    CanChemicalFormula                  -> SetSample1
+    CanDensity                          -> SetSample1
+    CanInnerRadius                      -> SetSample1
+    SetSample1                          -> MonteCarlo1
+    MonteCarlo1                         -> Multiply
+  useCorrections                    -> CanWorkspace2                [label="Yes"]
+    CanWorkspace2                       -> SetBeam2
+    SetBeam2                            -> SetSample2
+    CanOuterRadius                      -> SetSample2
+    CanChemicalFormula                  -> SetSample2
+    CanDensity                          -> SetSample2
+    SetSample2                          -> MonteCarlo2
+    MonteCarlo2                         -> Multiply
+  Multiply                          -> CanAbsorptionWorkspace
+  Multiply                          -> Divide
+  useCorrections                    -> Divide                   [label="No"]
+  Divide                            -> Minus
+  Minus                             -> ConvertUnits3            [label="Convert back to DeltaE"]
+canGiven                        -> ConvertUnits3                [label="No"]
+ConvertUnits3                   -> AddSampleLogMultiple
+AddSampleLogMultiple            -> GroupWorkspaces
+GroupWorkspaces                 -> OutputWorkspace
+}
diff --git a/docs/source/diagrams/IndirectCylinderAbsorption-v2_wkflw.dot b/docs/source/diagrams/IndirectCylinderAbsorption-v2_wkflw.dot
new file mode 100644
index 0000000000000000000000000000000000000000..9c17149b52f5f2aea37a409f136cdda1779767a1
--- /dev/null
+++ b/docs/source/diagrams/IndirectCylinderAbsorption-v2_wkflw.dot
@@ -0,0 +1,93 @@
+digraph IndirectFlatePlateAbsorption {
+  label="IndirectFlatePlateAbsorption Flowchart"
+  $global_style
+  
+  subgraph params  {
+    $param_style
+    SampleWorkspace1        [label="SampleWorkspace"]
+    SampleWorkspace2        [label="SampleWorkspace"]
+    SampleChemicalFormula
+    SampleDensity
+    SampleHeight
+    SampleRadius
+    SampleAngle
+    BeamHeight
+    BeamWidth
+    Events
+    NumberOfWavelengths
+    AbsWorkspace1           [label="AbsorptionWorkspace"]
+    AbsWorkspace2           [label="AbsorptionWorkspace"]
+    CanAbsorptionWorkspace
+    CanChemicalFormula
+    CanDensity
+    CanRadius
+    OutputWorkspace
+  }
+
+  subgraph algorithms  {
+    $algorithm_style
+    GetEFixed
+    ConvertUnits1           [label="ConvertUnits"]
+    ConvertUnits2           [label="ConvertUnits"]
+    ConvertUnits3           [label="ConvertUnits"]
+    SetBeam
+    SetBeam1                [label="SetBeam"]
+    SetSample
+    SetSample1              [label="SetSample"]
+    MonteCarlo
+    MonteCarlo1             [label="MonteCarlo"]
+    Scale
+    Divide
+    Minus
+    AddSampleLogMultiple
+    GroupWorkspaces
+    Multiply
+  }
+  
+  subgraph decisions {
+    $decision_style
+    canGiven          [label="Container Workspace?"]
+    useCorrections    [label="Container Corrections?"]
+  }
+
+SampleWorkspace1                 -> GetEFixed
+GetEFixed                        -> ConvertUnits1                   [label="Convert input workspace to Wavelength"]
+ConvertUnits1                    -> SetBeam
+BeamHeight                       -> SetBeam 
+BeamWidth                        -> SetBeam
+SetBeam                          -> SetSample
+SampleRadius                     -> SetSample
+SampleHeight                     -> SetSample
+SampleAngle                      -> SetSample
+SampleChemicalFormula            -> SetSample
+SampleDensity                    -> SetSample
+SetSample                        -> MonteCarlo
+Events                           -> MonteCarlo
+NumberOfWavelengths              -> MonteCarlo
+MonteCarlo                       -> AbsWorkspace1
+MonteCarlo                       -> canGiven
+canGiven                            -> ConvertUnits2                 [label="Yes"]
+  ConvertUnits2                     -> Scale
+  ConvertUnits2                     -> Clone
+  Scale                             -> Clone
+  Clone                             -> Divide1
+  SampleWorkspace2                  -> Divide1
+  AbsWorkspace2                     -> Divide1
+  Divide1                           -> useCorrections
+  useCorrections                    -> SetBeam1                     [label="Yes"]
+    SetBeam1                            -> SetSample1
+    CanChemicalFormula                  -> SetSample1
+    CanDensity                          -> SetSample1
+    CanRadius                           -> SetSample1
+    SetSample1                          -> MonteCarlo1
+    MonteCarlo1                         -> Multiply
+  Multiply                          -> CanAbsorptionWorkspace
+  Multiply                          -> Divide
+  useCorrections                    -> Divide                   [label="No"]
+  Divide                            -> Minus
+  Minus                             -> ConvertUnits3            [label="Convert back to DeltaE"]
+canGiven                        -> ConvertUnits3                [label="No"]
+ConvertUnits3                   -> AddSampleLogMultiple
+AddSampleLogMultiple            -> GroupWorkspaces
+GroupWorkspaces                 -> OutputWorkspace
+}
diff --git a/docs/source/diagrams/IndirectFlatPlateAbsorption-v2_wkflw.dot b/docs/source/diagrams/IndirectFlatPlateAbsorption-v2_wkflw.dot
new file mode 100644
index 0000000000000000000000000000000000000000..5c06070b231949ec4c8a6b3f6d59a6f02a3c8b38
--- /dev/null
+++ b/docs/source/diagrams/IndirectFlatPlateAbsorption-v2_wkflw.dot
@@ -0,0 +1,110 @@
+digraph IndirectFlatePlateAbsorption {
+  label="IndirectFlatePlateAbsorption Flowchart"
+  $global_style
+
+  subgraph params  {
+    $param_style
+    SampleWorkspace1        [label="SampleWorkspace"]
+    SampleWorkspace2        [label="SampleWorkspace"]
+    SampleChemicalFormula
+    SampleDensity
+    SampleHeight
+    SampleWidth
+    SampleThickness
+    SampleAngle
+    BeamHeight
+    BeamWidth
+    Events
+    NumberOfWavelengths
+    AbsWorkspace1           [label="AbsorptionWorkspace"]
+    AbsWorkspace2           [label="AbsorptionWorkspace"]
+    CanAbsorptionWorkspace
+    CanWorkspace1
+    CanWorkspace2
+    CanChemicalFormula
+    CanDensity
+    CanFrontThickness
+    CanBackThickness
+    OutputWorkspace
+  }
+
+  subgraph algorithms  {
+    $algorithm_style
+    GetEFixed
+    ConvertUnits1           [label="ConvertUnits"]
+    ConvertUnits2           [label="ConvertUnits"]
+    ConvertUnits3           [label="ConvertUnits"]
+    SetBeam
+    SetBeam1                [label="SetBeam"]
+    SetBeam2                [label="SetBeam"]
+    SetSample
+    SetSample1              [label="SetSample"]
+    SetSample2              [label="SetSample"]
+    MonteCarlo
+    MonteCarlo1             [label="MonteCarlo"]
+    MonteCarlo2             [label="MonteCarlo"]
+    Scale
+    Divide
+    Minus
+    AddSampleLogMultiple
+    GroupWorkspaces
+    Multiply
+  }
+
+  subgraph decisions {
+    $decision_style
+    canGiven          [label="Container Workspace?"]
+    useCorrections    [label="Container Corrections?"]
+  }
+
+SampleWorkspace1                 -> GetEFixed
+GetEFixed                        -> ConvertUnits1                   [label="Convert input workspace to Wavelength"]
+ConvertUnits1                    -> SetBeam
+BeamHeight                       -> SetBeam
+BeamWidth                        -> SetBeam
+SetBeam                          -> SetSample
+SampleHeight                     -> SetSample
+SampleWidth                      -> SetSample
+SampleThickness                  -> SetSample
+SampleAngle                      -> SetSample
+SampleChemicalFormula            -> SetSample
+SampleDensity                    -> SetSample
+SetSample                        -> MonteCarlo
+Events                           -> MonteCarlo
+NumberOfWavelengths              -> MonteCarlo
+MonteCarlo                       -> AbsWorkspace1
+MonteCarlo                       -> canGiven
+canGiven                            -> ConvertUnits2                 [label="Yes"]
+  ConvertUnits2                     -> Scale
+  ConvertUnits2                     -> Clone
+  Scale                             -> Clone
+  Clone                             -> Divide1
+  SampleWorkspace2                  -> Divide1
+  AbsWorkspace2                     -> Divide1
+  Divide1                           -> useCorrections
+  useCorrections                    -> CanWorkspace1                 [label="Yes"]
+    CanWorkspace1                       -> SetBeam1
+    SetBeam1                            -> SetSample1
+    CanFrontThickness                   -> SetSample1
+    CanChemicalFormula                  -> SetSample1
+    CanDensity                          -> SetSample1
+    SetSample1                          -> MonteCarlo1
+    MonteCarlo1                         -> Multiply
+  useCorrections                    -> CanWorkspace2                [label="Yes"]
+    CanWorkspace2                       -> SetBeam2
+    SetBeam2                            -> SetSample2
+    CanBackThickness                    -> SetSample2
+    CanChemicalFormula                  -> SetSample2
+    CanDensity                          -> SetSample2
+    SetSample2                          -> MonteCarlo2
+    MonteCarlo2                         -> Multiply
+  Multiply                          -> CanAbsorptionWorkspace
+  Multiply                          -> Divide
+  useCorrections                    -> Divide                   [label="No"]
+  Divide                            -> Minus
+  Minus                             -> ConvertUnits3            [label="Convert back to DeltaE"]
+canGiven                        -> ConvertUnits3                [label="No"]
+ConvertUnits3                   -> AddSampleLogMultiple
+AddSampleLogMultiple            -> GroupWorkspaces
+GroupWorkspaces                 -> OutputWorkspace
+}
diff --git a/docs/source/images/DPDFBackgroundRemover_01.png b/docs/source/images/DPDFBackgroundRemover_01.png
index 0423dbf61c2d5bf3e2ca28190e6cef813380ecb0..581b0f604b73b93ee549d8131b5f2a2ea29d3655 100644
Binary files a/docs/source/images/DPDFBackgroundRemover_01.png and b/docs/source/images/DPDFBackgroundRemover_01.png differ
diff --git a/docs/source/release/v3.10.0/framework.rst b/docs/source/release/v3.10.0/framework.rst
index c5e0d44e3a697b1df0e2ce660c34327eb489fc66..c1512caa458491911d5a44060196649164196e7d 100644
--- a/docs/source/release/v3.10.0/framework.rst
+++ b/docs/source/release/v3.10.0/framework.rst
@@ -34,6 +34,26 @@ Improved
 Python
 ------
 
+- For multiple output parameters, python algorithms now return a `namedtuple` instead of a tuple. Old scripts should still work,
+  but one can now do
+
+  .. code-block:: python
+
+      results = GetEi(w)
+      print(results)
+      print(results.IncidentEnergy)
+      print(results[0])
+
+  This will yield:
+
+  .. code-block:: python
+
+      GetEi_returns(IncidentEnergy=3.0, FirstMonitorPeak=0.0, FirstMonitorIndex=0, Tzero=61.77080180287334)
+      3.0
+      3.0
+
+
+
 Python Algorithms
 #################
 
diff --git a/docs/source/release/v3.10.0/indirect_inelastic.rst b/docs/source/release/v3.10.0/indirect_inelastic.rst
index e1c051dd670c953a7a4c0f7ab36a9e4e7fded97c..cac6bf144f6faeabdc3bc145073ff3eb27883b9f 100644
--- a/docs/source/release/v3.10.0/indirect_inelastic.rst
+++ b/docs/source/release/v3.10.0/indirect_inelastic.rst
@@ -11,6 +11,8 @@ New features
 Algorithms
 ##########
 
+- A new input property *RebinCanToSample* was added to :ref:`ApplyPaalmanPingsCorrection <algm-ApplyPaalmanPingsCorrection>` which enables or disables the rebinning of the empty container workspace.
+
 Data Analysis
 #############
 
diff --git a/scripts/CompareFitMinimizers/fitting_benchmarking.py b/scripts/CompareFitMinimizers/fitting_benchmarking.py
index fb4e9890e83eddd5464f60a0a391634728a87f20..582f53322c382d9d67082c1364d75ef99d651ab8 100644
--- a/scripts/CompareFitMinimizers/fitting_benchmarking.py
+++ b/scripts/CompareFitMinimizers/fitting_benchmarking.py
@@ -137,7 +137,7 @@ def do_fitting_benchmark(nist_group_dir=None, cutest_group_dir=None, neutron_dat
     prob_results = [do_fitting_benchmark_group(block, minimizers, use_errors=use_errors) for
                     block in problem_blocks]
 
-    probs, results = zip(*prob_results)
+    probs, results = list(zip(*prob_results))
 
     if len(probs) != len(results):
         raise RuntimeError('probs : {0}, prob_results: {1}'.format(len(probs), len(results)))
diff --git a/scripts/CompareFitMinimizers/post_processing.py b/scripts/CompareFitMinimizers/post_processing.py
index 2a947ace4b06391f913fb735f7908c4bbf5a56e9..ec92a02cc384d6c58a922c1b82f9492e88e664ea 100644
--- a/scripts/CompareFitMinimizers/post_processing.py
+++ b/scripts/CompareFitMinimizers/post_processing.py
@@ -18,6 +18,7 @@
 # File change history is stored at: <https://github.com/mantidproject/mantid>.
 # Code Documentation is available at: <http://doxygen.mantidproject.org>
 
+from __future__ import (absolute_import, division, print_function)
 import numpy as np
 from scipy import stats  # older version of numpy does not support nanmean and nanmedian
 
diff --git a/scripts/CompareFitMinimizers/test_problem.py b/scripts/CompareFitMinimizers/test_problem.py
index 5f8f80854b625bf736b42f837aae07e557804640..24f5ee2ea4e33ab6b3b9139eacf4ec370b5f51c6 100644
--- a/scripts/CompareFitMinimizers/test_problem.py
+++ b/scripts/CompareFitMinimizers/test_problem.py
@@ -17,6 +17,7 @@
 #
 # File change history is stored at: <https://github.com/mantidproject/mantid>.
 # Code Documentation is available at: <http://doxygen.mantidproject.org>
+from __future__ import (absolute_import, division, print_function)
 
 
 class FittingTestProblem(object):
diff --git a/scripts/CompareFitMinimizers/test_result.py b/scripts/CompareFitMinimizers/test_result.py
index ed4d663e957c5d031a01edee5738187ea4f25f36..5c2fb70ce42b6732d4b0d21a28e40852b03b9433 100644
--- a/scripts/CompareFitMinimizers/test_result.py
+++ b/scripts/CompareFitMinimizers/test_result.py
@@ -17,6 +17,7 @@
 #
 # File change history is stored at: <https://github.com/mantidproject/mantid>.
 # Code Documentation is available at: <http://doxygen.mantidproject.org>
+from __future__ import (absolute_import, division, print_function)
 
 
 class FittingTestResult(object):
diff --git a/scripts/DGSPlanner.py b/scripts/DGSPlanner.py
index 70b6858c25740abafaaa816e60113d23adee787f..cc9ef4e71eeec15c94d96946f62fecd7a5d1631b 100644
--- a/scripts/DGSPlanner.py
+++ b/scripts/DGSPlanner.py
@@ -1,4 +1,5 @@
 #pylint: disable=invalid-name,unused-import
+from __future__ import (absolute_import, division, print_function)
 import sys
 from PyQt4 import QtGui
 from DGSPlanner import DGSPlannerGUI
diff --git a/scripts/DGSPlanner/ClassicUBInputWidget.py b/scripts/DGSPlanner/ClassicUBInputWidget.py
index a27e76b8ffac0b5e8b8d030a052ab366d483dce4..ba92b2978ce164099f2c953b275bdd57aa7df57e 100644
--- a/scripts/DGSPlanner/ClassicUBInputWidget.py
+++ b/scripts/DGSPlanner/ClassicUBInputWidget.py
@@ -1,4 +1,5 @@
 #pylint: disable=invalid-name,no-name-in-module,too-many-instance-attributes
+from __future__ import (absolute_import, division, print_function)
 from PyQt4 import QtCore, QtGui
 import sys
 import mantid
diff --git a/scripts/DGSPlanner/DGSPlannerGUI.py b/scripts/DGSPlanner/DGSPlannerGUI.py
index 5038029e873bcd032adae7679bac7e8550a0414b..7a5f8b4e76a36db0d4c8860a677e27f49f608d1d 100644
--- a/scripts/DGSPlanner/DGSPlannerGUI.py
+++ b/scripts/DGSPlanner/DGSPlannerGUI.py
@@ -1,13 +1,14 @@
 #pylint: disable=invalid-name,relative-import
-import InstrumentSetupWidget
-import ClassicUBInputWidget
-import MatrixUBInputWidget
-import DimensionSelectorWidget
+from __future__ import (absolute_import, division, print_function)
+from . import InstrumentSetupWidget
+from . import ClassicUBInputWidget
+from . import MatrixUBInputWidget
+from . import DimensionSelectorWidget
 from PyQt4 import QtCore, QtGui
 import sys
 import mantid
 import mantidqtpython as mqt
-from ValidateOL import ValidateOL
+from .ValidateOL import ValidateOL
 from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
 from matplotlib.figure import Figure
 from  mpl_toolkits.axisartist.grid_helper_curvelinear import GridHelperCurveLinear
@@ -190,7 +191,7 @@ class DGSPlannerGUI(QtGui.QWidget):
                     if reply==QtGui.QMessageBox.No:
                         return
             if self.masterDict['makeFast']:
-                sp=range(mantid.mtd["__temp_instrument"].getNumberHistograms())
+                sp=list(range(mantid.mtd["__temp_instrument"].getNumberHistograms()))
                 tomask=sp[::4]+sp[1::4]+sp[2::4]
                 mantid.simpleapi.MaskDetectors("__temp_instrument",SpectraList=tomask)
             i=0
diff --git a/scripts/DGSPlanner/DimensionSelectorWidget.py b/scripts/DGSPlanner/DimensionSelectorWidget.py
index 9ea9a3d1b9c75626c10d6cbb6e1fc86f7af3db66..1c937076aad4724a35d7cd0f2979264e48a29c35 100644
--- a/scripts/DGSPlanner/DimensionSelectorWidget.py
+++ b/scripts/DGSPlanner/DimensionSelectorWidget.py
@@ -1,4 +1,5 @@
 #pylint: disable=invalid-name,no-name-in-module,too-many-instance-attributes,super-on-old-class,too-few-public-methods
+from __future__ import (absolute_import, division, print_function)
 from PyQt4 import QtGui, QtCore
 import sys
 import numpy
diff --git a/scripts/DGSPlanner/InstrumentSetupWidget.py b/scripts/DGSPlanner/InstrumentSetupWidget.py
index 295b3af826da5abf33a173422d021c67a5a74dfd..b33381750c651a662454660a9d7044f4c89efab6 100644
--- a/scripts/DGSPlanner/InstrumentSetupWidget.py
+++ b/scripts/DGSPlanner/InstrumentSetupWidget.py
@@ -1,4 +1,5 @@
 #pylint: disable=invalid-name,no-name-in-module,too-many-instance-attributes,too-many-public-methods
+from __future__ import (absolute_import, division, print_function)
 from PyQt4 import QtGui, QtCore
 import sys
 import mantid
diff --git a/scripts/DGSPlanner/MatrixUBInputWidget.py b/scripts/DGSPlanner/MatrixUBInputWidget.py
index 718a23b94aa731fbe026ef46fa64de4d8f81e068..5599c1099e6223fc4e9a4a050468de9886104d12 100644
--- a/scripts/DGSPlanner/MatrixUBInputWidget.py
+++ b/scripts/DGSPlanner/MatrixUBInputWidget.py
@@ -1,4 +1,5 @@
 #pylint: disable=invalid-name,no-name-in-module,too-many-public-methods
+from __future__ import (absolute_import, division, print_function)
 from PyQt4 import QtCore, QtGui
 import sys
 import mantid
diff --git a/scripts/DGSPlanner/ValidateOL.py b/scripts/DGSPlanner/ValidateOL.py
index 2510accbe1b6818f62c6f30d8c4dc9c382c663e2..cebcd776ac7d93bd851b1dc80cab80b09b597e2a 100644
--- a/scripts/DGSPlanner/ValidateOL.py
+++ b/scripts/DGSPlanner/ValidateOL.py
@@ -1,4 +1,5 @@
 #pylint: disable=invalid-name,bare-except
+from __future__ import (absolute_import, division, print_function)
 import mantid
 import numpy
 
diff --git a/scripts/Diffraction/isis_powder/abstract_inst.py b/scripts/Diffraction/isis_powder/abstract_inst.py
index 95ef5b5d55013261160c6ea59706615283c2c8aa..6e33a495871a2e1baf98d8c290321bada1f2e027 100644
--- a/scripts/Diffraction/isis_powder/abstract_inst.py
+++ b/scripts/Diffraction/isis_powder/abstract_inst.py
@@ -203,6 +203,7 @@ class AbstractInst(object):
         :return: A dictionary containing the various output paths and generated output name
         """
         output_directory = os.path.join(self._output_dir, run_details.label, self._user_name)
+        output_directory = os.path.abspath(os.path.expanduser(output_directory))
         file_name = str(self._generate_output_file_name(run_number_string=run_details.user_input_run_number))
         nxs_file = os.path.join(output_directory, (file_name + ".nxs"))
         gss_file = os.path.join(output_directory, (file_name + ".gsas"))
diff --git a/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py b/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
index 4275138490bdc130c9be64fa960bba0c6a0f0cec..b59b8952e5a2e2978dc452d4cbd3c2b2dc02d69d 100644
--- a/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
+++ b/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
@@ -44,7 +44,8 @@ def get_run_details(run_number_string, inst_settings):
     splined_vanadium_name = _generate_splined_van_name(chopper_on=inst_settings.chopper_on,
                                                        vanadium_run_string=vanadium_runs)
 
-    grouping_full_path = os.path.join(inst_settings.calibration_dir, inst_settings.grouping_file_name)
+    grouping_full_path = os.path.normpath(os.path.expanduser(inst_settings.calibration_dir))
+    grouping_full_path = os.path.join(grouping_full_path, inst_settings.grouping_file_name)
 
     in_calib_dir = os.path.join(inst_settings.calibration_dir, label)
     calibration_full_path = os.path.join(in_calib_dir, yaml_dict["offset_file_name"])
diff --git a/scripts/Diffraction/isis_powder/routines/InstrumentSettings.py b/scripts/Diffraction/isis_powder/routines/InstrumentSettings.py
index 7a46ab3db2da7a2030ca80181c6aee7eacf4820e..75e58cc181cc2136ccfcde3b798692bc46025d9a 100644
--- a/scripts/Diffraction/isis_powder/routines/InstrumentSettings.py
+++ b/scripts/Diffraction/isis_powder/routines/InstrumentSettings.py
@@ -20,6 +20,9 @@ class InstrumentSettings(object):
         self._basic_conf_dict = basic_conf_dict
         self._kwargs = kwargs
 
+        # We parse in the order advanced config, basic config (if specified), kwargs.
+        # This means that users can use the advanced config as a safe set of defaults, with their own preferences as
+        # the next layer which can override defaults and finally script arguments as their final override.
         self._parse_attributes(dict_to_parse=adv_conf_dict)
         self._parse_attributes(dict_to_parse=basic_conf_dict)
         self._parse_attributes(dict_to_parse=kwargs)
@@ -35,8 +38,8 @@ class InstrumentSettings(object):
             # has asked for a class attribute which does not exist. These attributes are set in a mapping file which
             # is passed in whilst InstrumentSettings is being constructed. Check that the 'script name' (i.e. not user
             # friendly name) is typed correctly in both the script(s) and mapping file.
-            raise AttributeError("The attribute in the script with name " + str(item) + " is unknown to the mapping."
-                                 "\nPlease contact the development team.")
+            raise AttributeError("The attribute in the script with name " + str(item) + " was not found in the "
+                                 "mapping file. \nPlease contact the development team.")
 
     def check_expected_attributes_are_set(self, expected_attr_names):
         for expected_attr in expected_attr_names:
@@ -54,6 +57,10 @@ class InstrumentSettings(object):
         self._kwargs = kwargs if kwargs else self._kwargs
 
         # Only update if one in hierarchy below it has been updated
+        # so if advanced_config has been changed we need to parse the basic and kwargs again to ensure
+        # the overrides are respected. Additionally we check whether we should suppress warnings based on
+        # whether this was the attribute that was changed. If it was then produce warnings - if we are
+        # reapplying overrides silence them.
         if advanced_config:
             self._parse_attributes(self._adv_config_dict, suppress_warnings=suppress_warnings)
         if advanced_config or basic_config:
diff --git a/scripts/Interface/reduction_gui/widgets/inelastic/dgs_sample_setup.py b/scripts/Interface/reduction_gui/widgets/inelastic/dgs_sample_setup.py
index 94f3b66bda7ec3da4b56b9a6b367a527f4bd533a..e6927e74865f6912b43d59ffbc419e526b777e89 100644
--- a/scripts/Interface/reduction_gui/widgets/inelastic/dgs_sample_setup.py
+++ b/scripts/Interface/reduction_gui/widgets/inelastic/dgs_sample_setup.py
@@ -90,7 +90,7 @@ class SampleSetupWidget(BaseWidget):
         self._content.horizontalLayout.removeWidget(self._content.sample_edit)
         self._content.horizontalLayout.removeWidget(self._content.sample_browse)
         spacer = self._content.horizontalLayout.takeAt(0)
-        self._content.sample_edit = mantidqtpython.MantidQt.MantidWidgets.MWRunFiles()
+        self._content.sample_edit = mantidqtpython.MantidQt.API.MWRunFiles()
         # Unfortunately, can only use live if default instrument = gui-set instrument
         if self._instrument_name == config.getInstrument().name():
             self._content.sample_edit.setProperty("liveButton","Show")
diff --git a/scripts/PyChop/ISISDisk.py b/scripts/PyChop/ISISDisk.py
index 2f04a9b67cb3bb8adad96fdda171a7f49e0b5d04..7e2b63a5a68a1c981cbb1206d9c19efabace92a5 100644
--- a/scripts/PyChop/ISISDisk.py
+++ b/scripts/PyChop/ISISDisk.py
@@ -203,7 +203,7 @@ class ISISDisk:
         if len(ie_list) == 1:
             chop_width = chop_width[ie_list]
             mod_width = mod_width[ie_list]
-            res_el = res_el[ie_list]
+            res_el = res_el[int(ie_list)]
         return Eis, res_list, res_el, percent, ie_list, chop_width, mod_width
 
     def getElasticResolution(self, Ei_in=None, frequency=None):
diff --git a/scripts/SANS/SANSBatchMode.py b/scripts/SANS/SANSBatchMode.py
index 9469adcfc03e574acc164c40df9988bcca8d7ffa..73bf446f154dbb983e51070f79628f8dd7e97148 100644
--- a/scripts/SANS/SANSBatchMode.py
+++ b/scripts/SANS/SANSBatchMode.py
@@ -119,7 +119,7 @@ def addRunToStore(parts, run_store):
     #move through the file like sample_sans,99630,output_as,99630, ...
     for i in range(0, nparts, 2):
         role = parts[i]
-        if role in inputdata.keys():
+        if role in list(inputdata.keys()):
             inputdata[parts[i]] = parts[i+1]
         else:
             issueWarning('You seem to have specified an invalid key in the SANSBatch file. The key was ' + str(role))
diff --git a/scripts/SANS/SANSUtility.py b/scripts/SANS/SANSUtility.py
index 36272bee57038df93e0c2159947b6b20d1a096cd..dfb8d3c057d573254c869ee2ab11aea802e1affb 100644
--- a/scripts/SANS/SANSUtility.py
+++ b/scripts/SANS/SANSUtility.py
@@ -730,11 +730,11 @@ def check_if_is_event_data(file_name):
         file_name = full_file_path[0]
     with h5.File(file_name) as h5_file:
         # Open first entry
-        keys = h5_file.keys()
+        keys = list(h5_file.keys())
         first_entry = h5_file[keys[0]]
         # Open instrument group
         is_event_mode = False
-        for value in first_entry.values():
+        for value in list(first_entry.values()):
             if "NX_class" in value.attrs and "NXevent_data" == value.attrs["NX_class"]:
                 is_event_mode = True
                 break
@@ -748,7 +748,7 @@ def is_nexus_file(file_name):
     is_nexus = True
     try:
         with h5.File(file_name) as h5_file:
-            keys = h5_file.keys()
+            keys = list(h5_file.keys())
             nexus_test = "raw_data_1" in keys or "mantid_workspace_1" in keys
             is_nexus = True if nexus_test else False
     except:  # noqa
@@ -1976,7 +1976,7 @@ def parseLogFile(logfile):
     file_log = open(logfile, 'rU')
     for line in file_log:
         entry = line.split()[1]
-        if entry in logkeywords.keys():
+        if entry in list(logkeywords.keys()):
             logkeywords[entry] = float(line.split()[2])
 
     return tuple(logkeywords.values())
diff --git a/scripts/SANS/isis_instrument.py b/scripts/SANS/isis_instrument.py
index f77d6a09ae0337b87d81017c16fba2f6c73d0515..ba9fedfc628c9fee7a2feaec7d8dc543b4d74706 100644
--- a/scripts/SANS/isis_instrument.py
+++ b/scripts/SANS/isis_instrument.py
@@ -337,7 +337,7 @@ class DetectorBank(object):
             @param guess: this name will be searched for in the list
             @return : True if the name was found, otherwise false
         """
-        for name in self._names.values():
+        for name in list(self._names.values()):
             if guess.lower() == name.lower():
                 return True
         return False
@@ -1407,7 +1407,7 @@ class SANS2D(ISISInstrument):
         try:
             log = self.get_detector_log(ws_ref)
             if log == "":
-                raise "Invalid log"
+                raise RuntimeError("Invalid log")
         except:
             if isSample:
                 raise RuntimeError('Sample logs cannot be loaded, cannot continue')
@@ -1749,7 +1749,7 @@ class LARMOR(ISISInstrument):
                 # logger.warning("Trying get_detector_log")
                 log = self.get_detector_log(ws_ref)
                 if log == "":
-                    raise "Invalid log"
+                    raise RuntimeError("Invalid log")
             except:
                 if isSample:
                     run = ws_ref.run()
diff --git a/scripts/SANS/isis_reducer.py b/scripts/SANS/isis_reducer.py
index 972d58642884ad285c662fbcb15dd52ccd3920ac..00e9eca23f41f1d7616d49f6d4261d3e8da7675c 100644
--- a/scripts/SANS/isis_reducer.py
+++ b/scripts/SANS/isis_reducer.py
@@ -1,4 +1,4 @@
-# pylint: disable=invalid-name, property-on-old-class, redefined-builtin, protected-access
+# pylint: disable=invalid-name, property-on-old-class, redefined-builtin, protected-access
 """
     ISIS-specific implementation of the SANS Reducer.
 
diff --git a/scripts/SANS/isis_reduction_steps.py b/scripts/SANS/isis_reduction_steps.py
index 9d98c3ed88dbb0d29d1c5ee11bc9febe708660a6..a69ee113432a1bdab5292446b14ba3bec2450280 100644
--- a/scripts/SANS/isis_reduction_steps.py
+++ b/scripts/SANS/isis_reduction_steps.py
@@ -2077,7 +2077,7 @@ class TransmissionCalc(ReductionStep):
             order_str = fit_method[10:]
             fit_method = 'POLYNOMIAL'
             self.fit_settings[select + ORDER] = int(order_str)
-        if fit_method not in self.TRANS_FIT_OPTIONS.keys():
+        if fit_method not in list(self.TRANS_FIT_OPTIONS.keys()):
             _issueWarning(
                 'ISISReductionStep.Transmission: Invalid fit mode passed to TransFit, using default method (%s)' % self.DEFAULT_FIT)
             fit_method = self.DEFAULT_FIT
@@ -2375,7 +2375,7 @@ class TransmissionCalc(ReductionStep):
         calc_trans_alg.setProperty("IncidentBeamMonitor", pre_sample)
         calc_trans_alg.setProperty("RebinParams", reducer.to_wavelen.get_rebin())
         calc_trans_alg.setProperty("OutputUnfittedData", True)
-        for name, value in options.items():
+        for name, value in list(options.items()):
             calc_trans_alg.setProperty(name, value)
 
         if self.trans_mon:
@@ -3307,7 +3307,7 @@ class UserFile(ReductionStep):
         upper_line = line.upper()
 
         # check for a recognised command
-        for keyword in self.key_functions.keys():
+        for keyword in list(self.key_functions.keys()):
             if upper_line.startswith(keyword):
                 # remove the keyword as it has already been parsed
                 params = line[len(keyword):]
diff --git a/scripts/SANS/reduction_settings.py b/scripts/SANS/reduction_settings.py
index c75d22107a1707b90776ee9de536a499fbe5817b..185794615c7527a9ca58da6fb1ba08db49b73aec 100644
--- a/scripts/SANS/reduction_settings.py
+++ b/scripts/SANS/reduction_settings.py
@@ -141,7 +141,7 @@ def get_settings_object(settings_prop_man_name=REDUCTION_SETTINGS_OBJ_NAME):
 
             new_prop_man = PropertyManagerPicklableWrapper(new_name)
             new_prop_man.clear()
-            for key, value in self.items():
+            for key, value in list(self.items()):
                 new_prop_man[key] = value
             return new_prop_man
 
diff --git a/scripts/SANS/sans/common/configurations.py b/scripts/SANS/sans/common/configurations.py
index 1586f21f1bb8860dd07b4b61a703fdc3703442a7..785aef0dc312ee65e6eb24e2a04efdd5cdea5bc3 100644
--- a/scripts/SANS/sans/common/configurations.py
+++ b/scripts/SANS/sans/common/configurations.py
@@ -1,6 +1,8 @@
 """ The SANSConfigurations class holds instrument-specific configs to centralize instrument-specific magic numbers"""
 # pylint: disable=too-few-public-methods
 
+from __future__ import (absolute_import, division, print_function)
+
 
 class Configurations(object):
 
diff --git a/scripts/SANS/sans/common/constants.py b/scripts/SANS/sans/common/constants.py
index 015990ba94ff23437b167a88b6a7910bd03af8e2..86be890cd0ec46194ad50c5138ca391330bfc9e4 100644
--- a/scripts/SANS/sans/common/constants.py
+++ b/scripts/SANS/sans/common/constants.py
@@ -2,6 +2,8 @@
 
 # pylint: disable=too-few-public-methods
 
+from __future__ import (absolute_import, division, print_function)
+
 # ----------------------------------------
 # Proeprty names for Algorithms
 # ---------------------------------------
diff --git a/scripts/SANS/sans/common/enums.py b/scripts/SANS/sans/common/enums.py
index 97ab8647c1b8b4bfeb2d3c96b8258bf06665a920..302e710ce9a6a9f599e0ee7ba2a640adf222bcc2 100644
--- a/scripts/SANS/sans/common/enums.py
+++ b/scripts/SANS/sans/common/enums.py
@@ -50,7 +50,7 @@ def string_convertible(cls):
     @return: the class
     """
     def to_string(elements, convert_to_string):
-        for key, value in elements.items():
+        for key, value in list(elements.items()):
             if convert_to_string is value:
                 return key
         raise RuntimeError("Could not convert {0} to string. Unknown value.".format(convert_to_string))
@@ -58,14 +58,14 @@ def string_convertible(cls):
     def from_string(elements, convert_from_string):
         if PY3 and isinstance(convert_from_string, bytes):
             convert_from_string = convert_from_string.decode()
-        for key, value in elements.items():
+        for key, value in list(elements.items()):
             if convert_from_string == key:
                 return value
         raise RuntimeError("Could not convert {0} from string. Unknown value.".format(convert_from_string))
 
     # First get all enum/sub-class elements
     convertible_elements = {}
-    for attribute_name, attribute_value in cls.__dict__.items():
+    for attribute_name, attribute_value in list(cls.__dict__.items()):
         if isclass(attribute_value) and issubclass(attribute_value, cls):
             convertible_elements.update({attribute_name: attribute_value})
 
diff --git a/scripts/SANS/sans/common/file_information.py b/scripts/SANS/sans/common/file_information.py
index 87990ac3e85752dab5d96cd2eeb1baaf549ff95b..eeac9dfe467befe6bcd64dc1854120299d8c364d 100644
--- a/scripts/SANS/sans/common/file_information.py
+++ b/scripts/SANS/sans/common/file_information.py
@@ -202,7 +202,7 @@ def get_isis_nexus_info(file_name):
     try:
         with h5.File(file_name) as h5_file:
             keys = list(h5_file.keys())
-            is_isis_nexus = u"raw_data_1" in keys
+            is_isis_nexus = "raw_data_1" in keys
             first_entry = h5_file["raw_data_1"]
             period_group = first_entry["periods"]
             proton_charge_data_set = period_group["proton_charge"]
@@ -286,7 +286,7 @@ def get_event_mode_information(file_name):
         first_entry = h5_file[keys[0]]
         # Open instrument group
         is_event_mode = False
-        for value in first_entry.values():
+        for value in list(first_entry.values()):
             if "NX_class" in value.attrs and "NXevent_data" == value.attrs["NX_class"]:
                 is_event_mode = True
                 break
diff --git a/scripts/SANS/sans/common/general_functions.py b/scripts/SANS/sans/common/general_functions.py
index e6776e6a018fb1d1572c4aff8a03418e1773295c..d1c3cd467dbb58c1aec243bbd452ce4508c89a83 100644
--- a/scripts/SANS/sans/common/general_functions.py
+++ b/scripts/SANS/sans/common/general_functions.py
@@ -2,6 +2,7 @@
 
 # pylint: disable=invalid-name
 
+from __future__ import (absolute_import, division, print_function)
 from math import (acos, sqrt, degrees)
 from mantid.api import AlgorithmManager, AnalysisDataService
 from mantid.kernel import (DateAndTime)
diff --git a/scripts/SANS/sans/common/xml_parsing.py b/scripts/SANS/sans/common/xml_parsing.py
index cf4aad14425f73411f5054037f7bd711152c83a8..13e576f6598e855bd67f564f71f2b4fe1d80f581 100644
--- a/scripts/SANS/sans/common/xml_parsing.py
+++ b/scripts/SANS/sans/common/xml_parsing.py
@@ -2,6 +2,8 @@
 
 # pylint: disable=invalid-name
 
+from __future__ import (absolute_import, division, print_function)
+
 try:
     import xml.etree.cElementTree as eTree
 except ImportError:
@@ -28,7 +30,7 @@ def get_named_elements_from_ipf_file(ipf_file, names_to_search, value_type):
     output = {}
     number_of_elements_to_search = len(names_to_search)
     for _, element in eTree.iterparse(ipf_file):
-        if element.tag == "parameter" and "name" in element.keys():
+        if element.tag == "parameter" and "name" in list(element.keys()):
             if element.get("name") in names_to_search:
                 sub_element = element.find("value")
                 value = sub_element.get("val")
@@ -53,7 +55,7 @@ def get_monitor_names_from_idf_file(idf_file):
     idname = "idname"
     id_tag = "id"
     for _, element in eTree.iterparse(idf_file):
-        if element.tag == get_tag(tag) and idname in element.keys():
+        if element.tag == get_tag(tag) and idname in list(element.keys()):
             name = element.get(idname)
             if "monitor" in name:
                 sub_element = element.find(get_tag(id_tag))
diff --git a/scripts/SANS/sans/state/adjustment.py b/scripts/SANS/sans/state/adjustment.py
index 3efcc340c75640f6a200f6eab210e949e31daa87..61db729effd2034b53cd1113a02baa8a6f763ffb 100644
--- a/scripts/SANS/sans/state/adjustment.py
+++ b/scripts/SANS/sans/state/adjustment.py
@@ -2,6 +2,7 @@
 
 """State describing the adjustment workspace creation of the SANS reduction."""
 
+from __future__ import (absolute_import, division, print_function)
 import json
 import copy
 from sans.state.state_base import (StateBase, TypedParameter, rename_descriptor_names, BoolParameter,
diff --git a/scripts/SANS/sans/state/automatic_setters.py b/scripts/SANS/sans/state/automatic_setters.py
index 427678c919cb23d91ae4e70f5ad8f8264abc794e..13444919704dba00d79bfdd78bd0b576c8e52058 100644
--- a/scripts/SANS/sans/state/automatic_setters.py
+++ b/scripts/SANS/sans/state/automatic_setters.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 from functools import (partial, wraps)
 import inspect
 
@@ -60,7 +61,7 @@ def create_automatic_setters_for_state(attribute_value, builder_instance, attrib
     all_descriptors = get_all_typed_parameter_descriptors(attribute_value)
 
     # Go through each descriptor and create a setter for it.
-    for name, value in all_descriptors.items():
+    for name, value in list(all_descriptors.items()):
         # If the name is in the exception list, then we don't want to create a setter for this attribute
         if name in exclusions:
             continue
@@ -74,7 +75,7 @@ def create_automatic_setters_for_state(attribute_value, builder_instance, attrib
             if dict_parameter_value is None or len(dict_parameter_value) == 0:
                 update_the_method(builder_instance, new_methods, setter_name, name, attribute_name_list)
             else:
-                for dict_key, dict_value in dict_parameter_value.items():
+                for dict_key, dict_value in list(dict_parameter_value.items()):
                     setter_name_copy = list(setter_name)
                     setter_name_copy.append(dict_key)
 
@@ -91,7 +92,7 @@ def create_automatic_setters_for_state(attribute_value, builder_instance, attrib
 def create_automatic_setters(builder_instance, state_class, exclusions):
     # Get the name of the state object
     new_methods = {}
-    for attribute_name, attribute_value in builder_instance.__dict__.items():
+    for attribute_name, attribute_value in list(builder_instance.__dict__.items()):
         if isinstance(attribute_value, state_class):
             attribute_name_list = [attribute_name]
             setter_name = ["set"]
@@ -99,7 +100,7 @@ def create_automatic_setters(builder_instance, state_class, exclusions):
                                                setter_name, exclusions, new_methods)
 
     # Apply the methods
-    for method_name, method in new_methods.items():
+    for method_name, method in list(new_methods.items()):
         builder_instance.__dict__.update({method_name: method})
 
 
diff --git a/scripts/SANS/sans/state/calculate_transmission.py b/scripts/SANS/sans/state/calculate_transmission.py
index 1388a6978831de4536f725b63c0939aa017cfdc7..9e4bd68a2cf772bd1303717073dc14005b43e5fb 100644
--- a/scripts/SANS/sans/state/calculate_transmission.py
+++ b/scripts/SANS/sans/state/calculate_transmission.py
@@ -2,6 +2,7 @@
 
 """State describing the calculation of the transmission for SANS reduction."""
 
+from __future__ import (absolute_import, division, print_function)
 import json
 import copy
 from sans.state.state_base import (StateBase, rename_descriptor_names, PositiveIntegerParameter, BoolParameter,
@@ -244,7 +245,7 @@ class StateCalculateTransmission(StateBase):
                                            {"background_TOF_monitor_start": self.background_TOF_monitor_start,
                                             "background_TOF_monitor_stop": self.background_TOF_monitor_stop})
                 is_invalid.update(entry)
-            for key_start, value_start in self.background_TOF_monitor_start.items():
+            for key_start, value_start in list(self.background_TOF_monitor_start.items()):
                 if key_start not in self.background_TOF_monitor_stop:
                     entry = validation_message("The monitor background TOF had spectrum number mismatch.",
                                                "Make sure that all monitors have entries for start and stop.",
diff --git a/scripts/SANS/sans/state/convert_to_q.py b/scripts/SANS/sans/state/convert_to_q.py
index a41a566f6624f7e9b8b7fb0caee746b5c6986587..c72844c9b729ab31dcf65bcc9932e730b8b86d09 100644
--- a/scripts/SANS/sans/state/convert_to_q.py
+++ b/scripts/SANS/sans/state/convert_to_q.py
@@ -2,6 +2,7 @@
 
 """State describing the conversion to momentum transfer"""
 
+from __future__ import (absolute_import, division, print_function)
 import json
 import copy
 from sans.state.state_base import (StateBase, rename_descriptor_names, BoolParameter, PositiveFloatParameter,
diff --git a/scripts/SANS/sans/state/data.py b/scripts/SANS/sans/state/data.py
index 8042264a3168d9acf5b5e5aa81cf7b2a4356795f..26a5bc9f03bbbdc3f61fe127f64a2f885bce47c0 100644
--- a/scripts/SANS/sans/state/data.py
+++ b/scripts/SANS/sans/state/data.py
@@ -1,7 +1,7 @@
-# pylint: disable=too-few-public-methods
+# pylint: disable=too-few-public-methods
 
 """State about the actual data which is to be reduced."""
-
+from __future__ import (absolute_import, division, print_function)
 import json
 import copy
 
diff --git a/scripts/SANS/sans/state/mask.py b/scripts/SANS/sans/state/mask.py
index 8c96299d50518ff2bbfa470632ed288a793eddcc..f0385d9dc980586137273fa2b4699a7b881b54d4 100644
--- a/scripts/SANS/sans/state/mask.py
+++ b/scripts/SANS/sans/state/mask.py
@@ -2,6 +2,7 @@
 
 """State describing the masking behaviour of the SANS reduction."""
 
+from __future__ import (absolute_import, division, print_function)
 import json
 import copy
 from sans.state.state_base import (StateBase, BoolParameter, StringListParameter, StringParameter,
@@ -228,7 +229,7 @@ class StateMask(StateBase):
         # --------------------
         # Detectors
         # --------------------
-        for _, value in self.detectors.items():
+        for _, value in list(self.detectors.items()):
             value.validate()
 
         if is_invalid:
diff --git a/scripts/SANS/sans/state/move.py b/scripts/SANS/sans/state/move.py
index 9fff81134be4ec03c07db46aace66d8e4baab425..c107aeb16b314846df45de03fbdaceee99297565 100644
--- a/scripts/SANS/sans/state/move.py
+++ b/scripts/SANS/sans/state/move.py
@@ -2,6 +2,7 @@
 
 """State for moving workspaces."""
 
+from __future__ import (absolute_import, division, print_function)
 import json
 import copy
 
diff --git a/scripts/SANS/sans/state/normalize_to_monitor.py b/scripts/SANS/sans/state/normalize_to_monitor.py
index 3b037e399d237aacfdfca7a15b6864c466949906..2219aa203afc6b5e04355ece19fbc9607c798d78 100644
--- a/scripts/SANS/sans/state/normalize_to_monitor.py
+++ b/scripts/SANS/sans/state/normalize_to_monitor.py
@@ -2,6 +2,7 @@
 
 """State describing the normalization to the incident monitor for SANS reduction."""
 
+from __future__ import (absolute_import, division, print_function)
 import json
 import copy
 from sans.state.state_base import (StateBase, rename_descriptor_names, PositiveIntegerParameter,
@@ -117,7 +118,7 @@ class StateNormalizeToMonitor(StateBase):
                                            {"background_TOF_monitor_start": self.background_TOF_monitor_start,
                                             "background_TOF_monitor_stop": self.background_TOF_monitor_stop})
                 is_invalid.update(entry)
-            for key_start, value_start in self.background_TOF_monitor_start.items():
+            for key_start, value_start in list(self.background_TOF_monitor_start.items()):
                 if key_start not in self.background_TOF_monitor_stop:
                     entry = validation_message("The monitor background TOF had spectrum number mismatch.",
                                                "Make sure that all monitors have entries for start and stop.",
diff --git a/scripts/SANS/sans/state/reduction_mode.py b/scripts/SANS/sans/state/reduction_mode.py
index 917973e9b7008996f5dca9b34f50917e7ce7adda..85d8e47dfea7434e614754751f68970ac36002ad 100644
--- a/scripts/SANS/sans/state/reduction_mode.py
+++ b/scripts/SANS/sans/state/reduction_mode.py
@@ -2,7 +2,9 @@
 
 """ Defines the state of the reduction."""
 
+from __future__ import (absolute_import, division, print_function)
 from abc import (ABCMeta, abstractmethod)
+from six import (with_metaclass)
 import copy
 
 from sans.state.state_base import (StateBase, ClassTypeParameter, FloatParameter, DictParameter,
@@ -17,9 +19,7 @@ from sans.state.automatic_setters import (automatic_setters)
 # ----------------------------------------------------------------------------------------------------------------------
 # State
 # ----------------------------------------------------------------------------------------------------------------------
-class StateReductionBase(object):
-    __metaclass__ = ABCMeta
-
+class StateReductionBase(with_metaclass(ABCMeta, object)):
     @abstractmethod
     def get_merge_strategy(self):
         pass
@@ -95,11 +95,11 @@ def setup_detectors_from_ipf(reduction_info, data_info):
                       DetectorType.to_string(DetectorType.HAB): "high-angle-detector-name"}
 
     names_to_search = []
-    names_to_search.extend(detector_names.values())
+    names_to_search.extend(list(detector_names.values()))
 
     found_detector_names = get_named_elements_from_ipf_file(ipf_path, names_to_search, str)
 
-    for detector_type in reduction_info.detector_names.keys():
+    for detector_type in list(reduction_info.detector_names.keys()):
         try:
             detector_name_tag = detector_names[detector_type]
             detector_name = found_detector_names[detector_name_tag]
diff --git a/scripts/SANS/sans/state/save.py b/scripts/SANS/sans/state/save.py
index cb1f03ef6f07de16ac109612c7050566a919d039..884f358a7d2388abde071cecb0cf9d4c1645a1a6 100644
--- a/scripts/SANS/sans/state/save.py
+++ b/scripts/SANS/sans/state/save.py
@@ -1,6 +1,8 @@
 # pylint: disable=too-few-public-methods
 
 """ Defines the state of saving."""
+
+from __future__ import (absolute_import, division, print_function)
 import copy
 from sans.state.state_base import (StateBase, BoolParameter, StringParameter,
                                    ClassTypeListParameter, rename_descriptor_names)
diff --git a/scripts/SANS/sans/state/scale.py b/scripts/SANS/sans/state/scale.py
index cf888b6209011d0939e3df618648522f4fd264d4..cc5964c3f42400a9f08d752e89668a3be918e199 100644
--- a/scripts/SANS/sans/state/scale.py
+++ b/scripts/SANS/sans/state/scale.py
@@ -1,4 +1,6 @@
 """ Defines the state of the geometry and unit scaling."""
+
+from __future__ import (absolute_import, division, print_function)
 import copy
 from sans.state.state_base import (StateBase, rename_descriptor_names, PositiveFloatParameter, ClassTypeParameter)
 from sans.common.enums import (SampleShape, SANSInstrument)
diff --git a/scripts/SANS/sans/state/slice_event.py b/scripts/SANS/sans/state/slice_event.py
index 744dd94e25523f2254acc74b80e2180d3cf6d7c7..8c550fb18b1fa2c26eea7147510f7ebc53867397 100644
--- a/scripts/SANS/sans/state/slice_event.py
+++ b/scripts/SANS/sans/state/slice_event.py
@@ -1,5 +1,6 @@
 """ Defines the state of the event slices which should be reduced."""
 
+from __future__ import (absolute_import, division, print_function)
 import json
 import copy
 from sans.state.state_base import (StateBase, rename_descriptor_names, FloatListParameter)
diff --git a/scripts/SANS/sans/state/state.py b/scripts/SANS/sans/state/state.py
index 7c5344caf767237946c3bdc54eb8fb713a88ec4b..5d596f49cb5c555b6ff376be6c26e60b6d1aeedd 100644
--- a/scripts/SANS/sans/state/state.py
+++ b/scripts/SANS/sans/state/state.py
@@ -2,6 +2,7 @@
 
 # pylint: disable=too-few-public-methods
 
+from __future__ import (absolute_import, division, print_function)
 import json
 import pickle
 import inspect
diff --git a/scripts/SANS/sans/state/state_base.py b/scripts/SANS/sans/state/state_base.py
index cf3d64cc88a2f9e8bec927426acd01f2673faf04..2e1ce23351279f4b674d5279934f56b2de8210d1 100644
--- a/scripts/SANS/sans/state/state_base.py
+++ b/scripts/SANS/sans/state/state_base.py
@@ -293,7 +293,7 @@ def rename_descriptor_names(cls):
     :param cls: The class with the TypedParameters
     :return: The class with the TypedParameters
     """
-    for attribute_name, attribute_value in cls.__dict__.items():
+    for attribute_name, attribute_value in list(cls.__dict__.items()):
         if isinstance(attribute_value, TypedParameter):
             attribute_value.name = '_{0}#{1}'.format(type(attribute_value).__name__, attribute_name)
     return cls
@@ -437,7 +437,7 @@ def convert_state_to_dict(instance):
     descriptor_values, descriptor_types = get_descriptor_values(instance)
     # Add the descriptors to a dict
     state_dict = dict()
-    for key, value in descriptor_values.items():
+    for key, value in list(descriptor_values.items()):
         # If the value is a SANSBaseState then create a dict from it
         # If the value is a dict, then we need to check what the sub types are
         # If the value is a ClassTypeParameter, then we need to encode it
@@ -448,7 +448,7 @@ def convert_state_to_dict(instance):
         elif isinstance(value, dict):
             # If we have a dict, then we need to watch out since a value in the dict might be a State
             sub_dictionary = {}
-            for key_sub, val_sub in value.items():
+            for key_sub, val_sub in list(value.items()):
                 if isinstance(val_sub, StateBase):
                     sub_dictionary_value = val_sub.property_manager
                 else:
diff --git a/scripts/SANS/sans/state/state_functions.py b/scripts/SANS/sans/state/state_functions.py
index 8f9da6622a351d756b53122806d9e8c8615e0a75..c68e61498500a35f1a7239db44c4e602374b0309 100644
--- a/scripts/SANS/sans/state/state_functions.py
+++ b/scripts/SANS/sans/state/state_functions.py
@@ -1,5 +1,6 @@
 """Set of general purpose functions which are related to the SANSState approach."""
 
+from __future__ import (absolute_import, division, print_function)
 from copy import deepcopy
 from sans.common.enums import (ReductionDimensionality, ISISReductionMode, OutputParts, DetectorType)
 from sans.common.constants import (ALL_PERIODS, REDUCED_WORKSPACE_NAME_IN_LOGS, EMPTY_NAME, REDUCED_CAN_TAG)
@@ -251,8 +252,8 @@ def set_detector_names(state, ipf_path):
                             hab_keyword: "high-angle-detector-short-name"}
 
     names_to_search = []
-    names_to_search.extend(detector_names.values())
-    names_to_search.extend(detector_names_short.values())
+    names_to_search.extend(list(detector_names.values()))
+    names_to_search.extend(list(detector_names_short.values()))
 
     found_detector_names = get_named_elements_from_ipf_file(ipf_path, names_to_search, str)
 
diff --git a/scripts/SANS/sans/state/wavelength.py b/scripts/SANS/sans/state/wavelength.py
index 963e65262819daec6daabe6b02d59cb5dfbcd55e..4ea26bcd9eec92b8c15a63eaa0bd1a7cf37fcd52 100644
--- a/scripts/SANS/sans/state/wavelength.py
+++ b/scripts/SANS/sans/state/wavelength.py
@@ -1,5 +1,6 @@
 """ Defines the state of the event slices which should be reduced."""
 
+from __future__ import (absolute_import, division, print_function)
 import json
 import copy
 
diff --git a/scripts/SANS/sans/state/wavelength_and_pixel_adjustment.py b/scripts/SANS/sans/state/wavelength_and_pixel_adjustment.py
index 2a363bc43d9801609a99d19053db1c13dd20d279..6b46654934c775c1ce4d4665a805531de06f7115 100644
--- a/scripts/SANS/sans/state/wavelength_and_pixel_adjustment.py
+++ b/scripts/SANS/sans/state/wavelength_and_pixel_adjustment.py
@@ -2,6 +2,7 @@
 
 """State describing the creation of pixel and wavelength adjustment workspaces for SANS reduction."""
 
+from __future__ import (absolute_import, division, print_function)
 import json
 import copy
 from sans.state.state_base import (StateBase, rename_descriptor_names, StringParameter,
diff --git a/scripts/test/SANS/common/enums_test.py b/scripts/test/SANS/common/enums_test.py
index 0db5728abc48344a3aa7be702ea305cb64c1f90f..781b0f02cbfa29aacf219c06d1c7cc519b1ff523 100644
--- a/scripts/test/SANS/common/enums_test.py
+++ b/scripts/test/SANS/common/enums_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
diff --git a/scripts/test/SANS/common/file_information_test.py b/scripts/test/SANS/common/file_information_test.py
index c4bc6d20115d76ee7eaec249b0bf5f8708c7e327..24091f55df58455169d088adc36012ef7cd3bb3b 100644
--- a/scripts/test/SANS/common/file_information_test.py
+++ b/scripts/test/SANS/common/file_information_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
diff --git a/scripts/test/SANS/common/general_functions_test.py b/scripts/test/SANS/common/general_functions_test.py
index bce83417d581cc553e727e60771b77a43b4d29de..52adc309300ceb1241f9c471f5552102184c8212 100644
--- a/scripts/test/SANS/common/general_functions_test.py
+++ b/scripts/test/SANS/common/general_functions_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
diff --git a/scripts/test/SANS/common/log_tagger_test.py b/scripts/test/SANS/common/log_tagger_test.py
index ab6610a4f5ca163c6910329eccb8ae2f8618ed2e..c410360110d64bcf1a09f29114668a9ea5ebbade 100644
--- a/scripts/test/SANS/common/log_tagger_test.py
+++ b/scripts/test/SANS/common/log_tagger_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 from mantid.api import AlgorithmManager
diff --git a/scripts/test/SANS/common/xml_parsing_test.py b/scripts/test/SANS/common/xml_parsing_test.py
index d71aaedb314dd4c3bdcd5004da0b9f6d30f391d7..0492200d0fb60fd538700496c5cced1ed9a32617 100644
--- a/scripts/test/SANS/common/xml_parsing_test.py
+++ b/scripts/test/SANS/common/xml_parsing_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
@@ -39,7 +40,7 @@ class XMLParsingTest(unittest.TestCase):
 
         # Assert
         self.assertTrue(len(results) == 10)
-        for key, value in results.items():
+        for key, value in list(results.items()):
             self.assertTrue(value == ("monitor"+str(key)))
 
     def test_that_monitors_can_be_found_v2(self):
@@ -56,7 +57,7 @@ class XMLParsingTest(unittest.TestCase):
 
         # Assert
         self.assertTrue(len(results) == 2)
-        for key, value in results.items():
+        for key, value in list(results.items()):
             self.assertTrue(value == ("monitor"+str(key)))
 
 
diff --git a/scripts/test/SANS/state/adjustment_test.py b/scripts/test/SANS/state/adjustment_test.py
index eaa0c7de8c0f8b5e6361db0c9b9f66697f9ec247..51fa240360ad1ca2155de554ab7b16902ad14a13 100644
--- a/scripts/test/SANS/state/adjustment_test.py
+++ b/scripts/test/SANS/state/adjustment_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
diff --git a/scripts/test/SANS/state/calculate_transmission_test.py b/scripts/test/SANS/state/calculate_transmission_test.py
index 05bfc162aea4833a1e159ca12d7e97fd341eb45c..7b39efb37f17f51fd14c816460b03e7800e2a248 100644
--- a/scripts/test/SANS/state/calculate_transmission_test.py
+++ b/scripts/test/SANS/state/calculate_transmission_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
@@ -15,7 +16,7 @@ class StateCalculateTransmissionTest(unittest.TestCase):
     @staticmethod
     def _set_fit(state, default_settings, custom_settings, fit_key):
         fit = state.fit[fit_key]
-        for key, value in default_settings.items():
+        for key, value in list(default_settings.items()):
             if key in custom_settings:
                 value = custom_settings[key]
             if value is not None:  # If the value is None, then don't set it
@@ -39,7 +40,7 @@ class StateCalculateTransmissionTest(unittest.TestCase):
                           "background_TOF_monitor_stop": {"1": 234, "2": 2323}, "background_TOF_roi_start": 12.,
                           "background_TOF_roi_stop": 123.}
 
-        for key, value in trans_settings.items():
+        for key, value in list(trans_settings.items()):
             if key in trans_entries:
                 value = trans_entries[key]
             if value is not None:  # If the value is None, then don't set it
diff --git a/scripts/test/SANS/state/convert_to_q_test.py b/scripts/test/SANS/state/convert_to_q_test.py
index 67713b964472f12911abbe041c78791f0912d30c..161ad2e387879d997679cfb73996b350ac1a8aa1 100644
--- a/scripts/test/SANS/state/convert_to_q_test.py
+++ b/scripts/test/SANS/state/convert_to_q_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
@@ -24,7 +25,7 @@ class StateConvertToQTest(unittest.TestCase):
                            "q_resolution_a2": 2., "q_resolution_h1": 1., "q_resolution_h2": 2., "q_resolution_w1": 1.,
                            "q_resolution_w2": 2.}
 
-        for key, value in default_entries.items():
+        for key, value in list(default_entries.items()):
             if key in convert_to_q_entries:
                 value = convert_to_q_entries[key]
             if value is not None:  # If the value is None, then don't set it
diff --git a/scripts/test/SANS/state/data_test.py b/scripts/test/SANS/state/data_test.py
index 39ead90f26597895d96fc394cf5e1dc9c45e4e3a..efd45a105e15223a28a0d520f55a7c3125262e56 100644
--- a/scripts/test/SANS/state/data_test.py
+++ b/scripts/test/SANS/state/data_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
@@ -17,7 +18,7 @@ class StateDataTest(unittest.TestCase):
                          "sample_direct": "test", "can_scatter": "test",
                          "can_transmission": "test", "can_direct": "test"}
 
-        for key, value in data_settings.items():
+        for key, value in list(data_settings.items()):
             if key in data_entries:
                 value = data_entries[key]
             if value is not None:  # If the value is None, then don't set it
diff --git a/scripts/test/SANS/state/mask_test.py b/scripts/test/SANS/state/mask_test.py
index 40c5561893055186619ebdc277a9d8aedc2baee0..d803f27d0e8b4746da7c7287ba15a89d32b619c3 100644
--- a/scripts/test/SANS/state/mask_test.py
+++ b/scripts/test/SANS/state/mask_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
@@ -17,7 +18,7 @@ class StateMaskTest(unittest.TestCase):
     @staticmethod
     def _set_detector(state, default_settings, custom_settings, detector_key):
         detector = state.detectors[detector_key]
-        for key, value in default_settings.items():
+        for key, value in list(default_settings.items()):
             if key in custom_settings:
                 value = custom_settings[key]
             if value is not None:  # If the value is None, then don't set it
@@ -38,7 +39,7 @@ class StateMaskTest(unittest.TestCase):
                          "spectrum_range_start": [1, 5, 7], "spectrum_range_stop": [2, 6, 8],
                          "idf_path": ""}
 
-        for key, value in mask_settings.items():
+        for key, value in list(mask_settings.items()):
             if key in general_entries:
                 value = general_entries[key]
             if value is not None:  # If the value is None, then don't set it
diff --git a/scripts/test/SANS/state/move_test.py b/scripts/test/SANS/state/move_test.py
index a993884455d1a5865aace873e6d62bb21be39f28..304ef6d624cb2d323bfcb3e2a0034900392e7ded 100644
--- a/scripts/test/SANS/state/move_test.py
+++ b/scripts/test/SANS/state/move_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
diff --git a/scripts/test/SANS/state/normalize_to_monitor_test.py b/scripts/test/SANS/state/normalize_to_monitor_test.py
index f7c902bf8f57e979c68844f748824b1b29cadb32..c469e0889056e21fd67b82068d088ee1dea08684 100644
--- a/scripts/test/SANS/state/normalize_to_monitor_test.py
+++ b/scripts/test/SANS/state/normalize_to_monitor_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
@@ -22,7 +23,7 @@ class StateNormalizeToMonitorTest(unittest.TestCase):
                            "background_TOF_monitor_start": {"1": 123, "2": 123},
                            "background_TOF_monitor_stop": {"1": 234, "2": 2323}}
 
-        for key, value in default_entries.items():
+        for key, value in list(default_entries.items()):
             if key in kwargs:
                 value = kwargs[key]
             if value is not None:  # If the value is None, then don't set it
diff --git a/scripts/test/SANS/state/reduction_mode_test.py b/scripts/test/SANS/state/reduction_mode_test.py
index c4f87b9644cfa41625282a266297811e34a98b1b..dc12c3e94ab5a4be7a88440140423e0a8f0edd8e 100644
--- a/scripts/test/SANS/state/reduction_mode_test.py
+++ b/scripts/test/SANS/state/reduction_mode_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
diff --git a/scripts/test/SANS/state/save_test.py b/scripts/test/SANS/state/save_test.py
index 5cac8305027d05afcf15daae50b4d08b7e68001d..203961a79256c114f932026399252b26c05423e4 100644
--- a/scripts/test/SANS/state/save_test.py
+++ b/scripts/test/SANS/state/save_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
diff --git a/scripts/test/SANS/state/scale_test.py b/scripts/test/SANS/state/scale_test.py
index 144ece7f2dc8192676b54359fa4247183ffa894c..6fe837552dabe0addb24164e0625220c516f5887 100644
--- a/scripts/test/SANS/state/scale_test.py
+++ b/scripts/test/SANS/state/scale_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
diff --git a/scripts/test/SANS/state/slice_event_test.py b/scripts/test/SANS/state/slice_event_test.py
index 15f24eaf5fb328f0157853940551e571eb5ecd2a..ad159aee772d756630d2f9a2c316da7b0137d0e0 100644
--- a/scripts/test/SANS/state/slice_event_test.py
+++ b/scripts/test/SANS/state/slice_event_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
diff --git a/scripts/test/SANS/state/state_base_test.py b/scripts/test/SANS/state/state_base_test.py
index 21c3ecea15b30fd56f3dd28f58e790bf8c86f442..29c525ed7385c989ee421135b23a31456e4cf853 100644
--- a/scripts/test/SANS/state/state_base_test.py
+++ b/scripts/test/SANS/state/state_base_test.py
@@ -126,7 +126,7 @@ class SANSParameterTest(unittest.TestCase):
         test_class = SANSParameterTest.SANSParameterTestClass()
         test_class.my_string_parameter = "test"
         test_class.my_bool_parameter = True
-        keys = test_class.__dict__.keys()
+        keys = list(test_class.__dict__.keys())
         # We don't have a sensible name in the instance dictionary
         self.assertTrue("_BoolParameter#my_bool_parameter" in keys)
         self.assertTrue("_StringParameter#my_string_parameter" in keys)
@@ -135,7 +135,7 @@ class SANSParameterTest(unittest.TestCase):
         test_class = SANSParameterTest.SANSParameterTestClass2()
         test_class.my_string_parameter = "test"
         test_class.my_bool_parameter = True
-        keys = test_class.__dict__.keys()
+        keys = list(test_class.__dict__.keys())
         # We don't have a sensible name in the instance dictionary.
         # It will be rather stored as something like: _BoolParameter#2 etc.
         self.assertTrue("_BoolParameter#my_bool_parameter" not in keys)
diff --git a/scripts/test/SANS/state/state_functions_test.py b/scripts/test/SANS/state/state_functions_test.py
index e974ae3624c80b4727bd4cf2544326944dfd575b..acfac65f524254b4ec59a361b4beaf9661eb6e0b 100644
--- a/scripts/test/SANS/state/state_functions_test.py
+++ b/scripts/test/SANS/state/state_functions_test.py
@@ -51,7 +51,7 @@ class StateFunctionsTest(unittest.TestCase):
             AnalysisDataService.addOrReplace(workspace_name, workspace)
 
         if tagged_workspace_names is not None:
-            for key, value in tagged_workspace_names.items():
+            for key, value in list(tagged_workspace_names.items()):
                 create_alg.execute()
                 workspace = create_alg.getProperty("OutputWorkspace").value
                 AnalysisDataService.addOrReplace(value, workspace)
diff --git a/scripts/test/SANS/state/state_test.py b/scripts/test/SANS/state/state_test.py
index 7dea7471e46784143f7511df974db694f65581cb..b1102b4a97a1a31001a35d3f3423762d9dcb175d 100644
--- a/scripts/test/SANS/state/state_test.py
+++ b/scripts/test/SANS/state/state_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
@@ -105,7 +106,7 @@ class StateTest(unittest.TestCase):
                            "save": MockStateSave(), "scale": MockStateScale(), "adjustment": MockStateAdjustment(),
                            "convert_to_q": MockStateConvertToQ()}
 
-        for key, value in default_entries.items():
+        for key, value in list(default_entries.items()):
             if key in entries:
                 value = entries[key]
             if value is not None:  # If the value is None, then don't set it
diff --git a/scripts/test/SANS/state/state_test_helper.py b/scripts/test/SANS/state/state_test_helper.py
index b8752e37bf56d0debb1f9b3f2439f5f450a06bb0..a641832103079cfeaaae03e91c0e7f7b3b25d255 100644
--- a/scripts/test/SANS/state/state_test_helper.py
+++ b/scripts/test/SANS/state/state_test_helper.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 def assert_validate_error(caller, error_type, obj):
     try:
         obj.validate()
diff --git a/scripts/test/SANS/state/test_director.py b/scripts/test/SANS/state/test_director.py
index 8f17df8b1502a491055d62c256ce8de125931dcc..b0a241033643fdbbe31e17198cdc21d17f877536 100644
--- a/scripts/test/SANS/state/test_director.py
+++ b/scripts/test/SANS/state/test_director.py
@@ -1,4 +1,5 @@
 """ A Test director """
+from __future__ import (absolute_import, division, print_function)
 from sans.state.state import get_state_builder
 from sans.state.data import get_data_builder
 from sans.state.move import get_move_builder
diff --git a/scripts/test/SANS/state/wavelength_and_pixel_adjustment_test.py b/scripts/test/SANS/state/wavelength_and_pixel_adjustment_test.py
index 15b54ab808adb5c0714930cd1c94d7a9364cf10a..fdcf5508cd7539af32c9b7bdfe8324028ec0ea2f 100644
--- a/scripts/test/SANS/state/wavelength_and_pixel_adjustment_test.py
+++ b/scripts/test/SANS/state/wavelength_and_pixel_adjustment_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
diff --git a/scripts/test/SANS/state/wavelength_test.py b/scripts/test/SANS/state/wavelength_test.py
index 11dd84c6e3f49f6a4b241deeb8314db5253a8d6c..d38ef564095f9c9734a3c7c948806dc3cb8a02d4 100644
--- a/scripts/test/SANS/state/wavelength_test.py
+++ b/scripts/test/SANS/state/wavelength_test.py
@@ -1,3 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
 import unittest
 import mantid
 
diff --git a/scripts/test/SANSUserFileParserTest.py b/scripts/test/SANSUserFileParserTest.py
index 53133902969f4763ea5705177e3ba773392e9d25..40cae791c48ff06033e9ee583210c6b159b8008c 100644
--- a/scripts/test/SANSUserFileParserTest.py
+++ b/scripts/test/SANSUserFileParserTest.py
@@ -106,11 +106,11 @@ class BackCommandParserTest(unittest.TestCase):
         # Act
         result = parser.parse_and_set(arguments)
         # Assert
-        self.assertEquals(result.mean, expected_mean)
-        self.assertEquals(result.time, expected_uniform)
-        self.assertEquals(result.mon, is_mon)
-        self.assertEquals(result.run_number, expected_run_number)
-        self.assertEquals(result.mon_number, expected_mon_number)
+        self.assertEqual(result.mean, expected_mean)
+        self.assertEqual(result.time, expected_uniform)
+        self.assertEqual(result.mon, is_mon)
+        self.assertEqual(result.run_number, expected_run_number)
+        self.assertEqual(result.mon_number, expected_mon_number)
 
     def do_test_parsing_fails(self, arguments):
         # Arrange
diff --git a/tools/DOI/authors.py b/tools/DOI/authors.py
index e3d17f35a5a42a08da05fe36fe236d55f3e5e017..9ec2267685c2b5e223c38ae086073cbffcaef85c 100644
--- a/tools/DOI/authors.py
+++ b/tools/DOI/authors.py
@@ -88,6 +88,7 @@ _translations = {
     'Federico M Pouzols'      : 'Pouzols, Federico M',
     'FedeMPouzols'            : 'Pouzols, Federico M',
     'Federico Montesino Pouzols': 'Pouzols, Federico M',
+    'Fede'                    : 'Pouzols, Federico M',
     'Anton Piccardo-Selg'     : 'Piccardo-Selg, Anton',
     'Lottie Greenwood'        : 'Greenwood, Lottie',
     'Dan Nixon'               : 'Nixon, Dan',
@@ -128,11 +129,21 @@ _translations = {
     'DavidFair'               : 'Fairbrother, David',
     'Eltayeb Ahmed'           : 'Ahmed, Eltayeb',
     'Dimitar Tasev'           : 'Tasev, Dimitar',
+    'Dimitar Borislavov Tasev': 'Tasev, Dimitar',
     'Antti Soininen'          : 'Soininen, Antti',
+    'Antti Soininnen'         : 'Soininen, Antti',
     'Pranav Bahuguna'         : 'Bahuguna, Pranav',
     'Louise McCann'           : 'McCann, Louise',
     'louisemccann'            : 'McCann, Louise',
-    'Gagik Vardanyan'         : 'Vardanyan, Gagik'
+    'Gagik Vardanyan'         : 'Vardanyan, Gagik',
+    'Verena Reimund'          : 'Reimund, Verena',
+    'reimundILL'              : 'Reimund, Verena',
+    'Krzysztof Dymkowski'     : 'Dymkowski, Krzysztof',
+    'dymkowsk'                : 'Dymkowski, Krzysztof',
+    'Gemma Guest'             : 'Guest, Gemma',
+    'Anthony Lim'             : 'Lim, Anthony',
+    'AnthonyLim23'            : 'Lim, Anthony',
+    'CipPruteanu'             : 'Ciprian Pruteanu'
 }
 
 # Used to ensure a Git author does not appear in any of the DOIs.  This is NOT