diff --git a/Code/Mantid/Build/CMake/DarwinSetup.cmake b/Code/Mantid/Build/CMake/DarwinSetup.cmake
index 59a5d0a6be297522f7d09136794fca5063164dc0..9821a44e261db29f3f377f2ce4d3605e8630ae08 100644
--- a/Code/Mantid/Build/CMake/DarwinSetup.cmake
+++ b/Code/Mantid/Build/CMake/DarwinSetup.cmake
@@ -80,7 +80,7 @@ endif ()
 # Force 64-bit compiler as that's all we support
 ###########################################################################
 
-set ( CLANG_WARNINGS "-Wall -Wextra -Winit-self -Wpointer-arith -Wcast-qual -fno-common  -Wno-deprecated-register")
+set ( CLANG_WARNINGS "-Wall -Wextra -pedantic -Winit-self -Wpointer-arith -Wcast-qual -fno-common  -Wno-deprecated-register")
 
 set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 ${CLANG_WARNINGS}" )
 set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=c++0x" )
diff --git a/Code/Mantid/Build/CMake/FindJsonCPP.cmake b/Code/Mantid/Build/CMake/FindJsonCPP.cmake
index c52d1418812beaa04c755d26d6616531f0f5fd37..a28f35fd333419710e6fd43c98b8c88ac28fbacb 100644
--- a/Code/Mantid/Build/CMake/FindJsonCPP.cmake
+++ b/Code/Mantid/Build/CMake/FindJsonCPP.cmake
@@ -9,11 +9,6 @@
 #  JSONCPP_LIBRARY_DEBUG  - library files for linking (debug version)
 #  JSONCPP_LIBRARIES      - All required libraries, including the configuration type
 
-# Using unset here is a temporary hack to force FindJson to find the correct
-# path in an incremental build. It should be removed a day or two after the
-# branch introducing this is merged.
-unset ( JSONCPP_INCLUDE_DIR CACHE )
-
 # Headers
 find_path ( JSONCPP_INCLUDE_DIR json/reader.h
             PATH_SUFFIXES jsoncpp )
diff --git a/Code/Mantid/Build/CMake/GNUSetup.cmake b/Code/Mantid/Build/CMake/GNUSetup.cmake
index 37d6f9bc32dbe8edbdc4f053ec18209516b5163f..67b373b55a4bbe10b4e764cc16480e1ae960fa87 100644
--- a/Code/Mantid/Build/CMake/GNUSetup.cmake
+++ b/Code/Mantid/Build/CMake/GNUSetup.cmake
@@ -24,9 +24,10 @@ set( GNUFLAGS "-Wall -Wextra -Wconversion -Winit-self -Wpointer-arith -Wcast-qua
 set( GNUFLAGS "${GNUFLAGS} -Wno-deprecated -Wno-write-strings")
 
 # Check if we have a new enough version for this flag
+# some -pedantic warnings remain with gcc 4.4.7
 if ( CMAKE_COMPILER_IS_GNUCXX )
-  if (GCC_COMPILER_VERSION VERSION_GREATER "4.3")
-    set(GNUFLAGS "${GNUFLAGS} -Wno-unused-result")
+  if (NOT (GCC_COMPILER_VERSION VERSION_LESS "4.5"))
+    set(GNUFLAGS "${GNUFLAGS} -Wno-unused-result -pedantic")
   endif ()
 elseif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
     set(GNUFLAGS "${GNUFLAGS} -Wno-sign-conversion")
diff --git a/Code/Mantid/Framework/API/CMakeLists.txt b/Code/Mantid/Framework/API/CMakeLists.txt
index 543277381857054fd04622824217d944f6176be5..1a8ece42503b648102159f60ac84b77ebfd39880 100644
--- a/Code/Mantid/Framework/API/CMakeLists.txt
+++ b/Code/Mantid/Framework/API/CMakeLists.txt
@@ -106,6 +106,7 @@ set ( SRC_FILES
 	src/PropertyManagerDataService.cpp
 	src/PropertyNexus.cpp
 	src/RefAxis.cpp
+	src/RemoteJobManagerFactory.cpp
 	src/Run.cpp
 	src/Sample.cpp
 	src/SampleEnvironment.cpp
@@ -221,6 +222,7 @@ set ( INC_FILES
 	inc/MantidAPI/IPeakFunction.h
 	inc/MantidAPI/IPeaksWorkspace.h
 	inc/MantidAPI/IPowderDiffPeakFunction.h
+	inc/MantidAPI/IRemoteJobManager.h
 	inc/MantidAPI/ISpectrum.h
 	inc/MantidAPI/ISplittersWorkspace.h
 	inc/MantidAPI/ITableWorkspace.h
@@ -270,6 +272,7 @@ set ( INC_FILES
 	inc/MantidAPI/PropertyManagerDataService.h
 	inc/MantidAPI/PropertyNexus.h
 	inc/MantidAPI/RefAxis.h
+	inc/MantidAPI/RemoteJobManagerFactory.h
 	inc/MantidAPI/Run.h
 	inc/MantidAPI/Sample.h
 	inc/MantidAPI/SampleEnvironment.h
@@ -366,6 +369,7 @@ set ( TEST_FILES
 	ProjectionTest.h
 	PropertyManagerDataServiceTest.h
 	PropertyNexusTest.h
+	RemoteJobManagerFactoryTest.h
 	RunTest.h
 	SampleEnvironmentTest.h
 	SampleShapeValidatorTest.h
diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/DomainCreatorFactory.h b/Code/Mantid/Framework/API/inc/MantidAPI/DomainCreatorFactory.h
index 09f4ab0100b4c64b744ee0d7eca25925be979dc6..0b232c59f0d87ea764047d9ec93bc4b8dafacfb6 100644
--- a/Code/Mantid/Framework/API/inc/MantidAPI/DomainCreatorFactory.h
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/DomainCreatorFactory.h
@@ -59,7 +59,7 @@ private:
   /// Private Constructor for singleton class
   DomainCreatorFactoryImpl();
   /// No copying
-  DISABLE_COPY_AND_ASSIGN(DomainCreatorFactoryImpl);
+  DISABLE_COPY_AND_ASSIGN(DomainCreatorFactoryImpl)
   /// Private Destructor for singleton
   virtual ~DomainCreatorFactoryImpl();
 
diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/FunctionParameterDecorator.h b/Code/Mantid/Framework/API/inc/MantidAPI/FunctionParameterDecorator.h
index 533c9942cdd251169ddc1fa24ea1386ef566d14b..78fd23781cbfba3733de852912260fe029f9b530 100644
--- a/Code/Mantid/Framework/API/inc/MantidAPI/FunctionParameterDecorator.h
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/FunctionParameterDecorator.h
@@ -50,6 +50,11 @@ public:
 
   IFunction_sptr clone() const;
 
+  virtual void setWorkspace(boost::shared_ptr<const Workspace> ws);
+  virtual void
+  setMatrixWorkspace(boost::shared_ptr<const MatrixWorkspace> workspace,
+                     size_t wi, double startX, double endX);
+
   /// Set i-th parameter of decorated function.
   virtual void setParameter(size_t i, const double &value,
                             bool explicitlySet = true);
diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h b/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h
new file mode 100644
index 0000000000000000000000000000000000000000..eb6d2ef97bd9dc3a643f69368c4be2be348d5757
--- /dev/null
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h
@@ -0,0 +1,280 @@
+#ifndef MANTID_KERNEL_IREMOTEJOBMANAGER_H
+#define MANTID_KERNEL_IREMOTEJOBMANAGER_H
+
+#include "MantidAPI/DllConfig.h"
+#include "MantidKernel/DateAndTime.h"
+
+namespace Mantid {
+namespace API {
+/**
+Common interface to different remote job managers (job schedulers, web
+services, etc. such as MOAB, Platform LSF, or SLURM).
+
+IremoteJobManager objects are (in principle) created via the
+RemoteJobManagerFactory.  There are several "remote algorithms" in
+Mantid: Authenticate, SubmitRemoteJob, QueryRemoteJobStatus,
+etc. These algorithms are meant to use this interface to the different
+specific implementations. Or, from the opposite angle, the methods of
+this interface provide the functionality required by the remote
+algorithms in a generic way (with respect to different job schedulers
+or underlying mechanisms to handle remote jobs). So-called remote job
+manager classes can implement this interface to provide
+specialisations for Platform LSF, SLURM, MOAB, the Mantid web service
+API, etc.
+
+A typical sequence of calls when you use this interface would be:
+
+1) Authenticate/log-in (authenticate())
+2) Do transactions
+
+Where the sequence of calls within a transaction is:
+
+2.1) Start transaction (startRemoteTransaction())
+2.2) Do actions
+2.3) Stop transaction (stopRemoteTransaction())
+
+In 2.2, several types of actions are possible:
+- Submit a job to run on the (remote) compute resource (submitRemoteJob()).
+- Get status info for one or all jobs (queryRemoteJob() and
+queryAllRemoteJobs()).
+- Cancel a job (abortRemoteJob()).
+- Get list of available files for a transaction on the compute resource
+(queryRemoteFile())
+- Upload / download files ( uploadRemoteFile() and downloadRemoteFile()).
+
+
+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>.
+Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+class MANTID_API_DLL IRemoteJobManager {
+public:
+  virtual ~IRemoteJobManager(){};
+
+  /**
+   * Status and general information about jobs running on (remote)
+   * compute resources.
+   */
+  struct RemoteJobInfo {
+    /// Job ID, usually assigned by a job scheduler as an integer
+    /// number or similar.
+    std::string id;
+    /// name of the job, whether given by the user or automatically
+    /// assigned by the job scheduler
+    std::string name;
+    /// Name of the script or executable. Depending on the specific
+    /// implementation, job scheduler, etc. this can be an
+    /// 'application' name, a script name or different ways of
+    /// specifying what is run
+    std::string runnableName;
+    /// Last status retrieved (typically: Pending, Running, Exited,
+    /// etc.). The values are implementation/job scheduler dependent.
+    std::string status;
+    /// ID of the transaction where this job is included
+    std::string transactionID;
+    /// Date-time of submission. No particular format can be assumed
+    /// from the specific remote job managers, and some of them may
+    /// not provide this info
+    Mantid::Kernel::DateAndTime submitDate;
+    /// Date-time the job actually started running.  No particular
+    /// format can be assumed
+    Mantid::Kernel::DateAndTime startDate;
+    /// Date-time the job finished. No particular format can be
+    /// assumed
+    Mantid::Kernel::DateAndTime completionTime;
+  };
+
+  /**
+   * Authenticate or log-in, previous to submitting jobs, up/downloading, etc.
+   *
+   * @param username User name or credentials
+   *
+   * @param password Password (or other type of authentication token)
+   * string.
+   *
+   * @throws std::invalid_argument If any of the inputs is not set
+   * properly.
+   * @throws std::runtime_error If authentication fails
+   */
+  virtual void authenticate(const std::string &username,
+                            const std::string &password) = 0;
+
+  /**
+   * Submit a job (and implicitly request to start it) within a
+   * transaction.
+   *
+   * @param transactionID ID obtained from a startRemoteTransaction()
+   *
+   * @param runnable Name of the script or executable for the
+   * job. This can be a name or path to a file (implementation
+   * dependent).
+   *
+   * @param param Parameters for the job. This is implementation
+   * dependent and may be a list of command line options, the name of
+   * a script or configuration file, the contents of a script to run
+   * or configuration template, etc. For example, for the Mantid web
+   * service API, this is the content of a python script.
+   *
+   * @param taskName (optional) human readable name for this job.
+   *
+   * @param numNodes number of nodes to use (optional and dependent on
+   * implementation and compute resource)
+   *
+   * @param coresPerNode number of cores to use in each node (optional
+   * and dependent on implemenation and compute resource)
+   *
+   * @return jobID string for the job started (if successful).
+   *
+   * @throws std::invalid_argument If any of the inputs is not set
+   * properly.
+   * @throws std::runtime_error if job submission fails.
+   */
+  virtual std::string
+  submitRemoteJob(const std::string &transactionID, const std::string &runnable,
+                  const std::string &param, const std::string &taskName = "",
+                  const int numNodes = 1, const int coresPerNode = 1) = 0;
+
+  /**
+   * Get/download a file from the (remote) compute resource.
+   *
+   * @param transactionID ID obtained from a startRemoteTransaction()
+   *
+   * @param remoteFileName Name of file on the (remote) compute
+   * resource. This can be a full or relative path or a simple file
+   * name, depending on implementation.
+   *
+   * @param localFileName Where to place the downloaded file on the
+   * local machine.
+   *
+   * @throws std::invalid_argument If any of the inputs is not set
+   * properly.
+   * @throws std::runtime_error If the download operation fails
+   */
+  virtual void downloadRemoteFile(const std::string &transactionID,
+                                  const std::string &remoteFileName,
+                                  const std::string &localFileName) = 0;
+
+  /**
+   * Get information (status etc.) for all running jobs on the remote
+   * compute resource
+   *
+   * @return Status and general info for all the jobs found on the
+   * (remote) compute resource. Each of them should come identified by
+   * its ID.
+   *
+   * @throws std::runtime_error If the query fails
+   */
+  virtual std::vector<RemoteJobInfo> queryAllRemoteJobs() const = 0;
+
+  /**
+   * Get the list of files available for a transaction at the (remote)
+   * compute resource.
+   *
+   * @param transactionID ID obtained from startRemoteTransaction()
+   *
+   * @return The names of all the available files
+   *
+   * @throws std::invalid_argument If there's an issue with the
+   * transaction ID
+   *
+   * @throws std::runtime_error If the query fails
+   */
+  virtual std::vector<std::string>
+  queryRemoteFile(const std::string &transactionID) const = 0;
+
+  /**
+   * Get information (status etc.) for an (in principle) running job
+   *
+   * @param jobID ID of a job as obtained from submitRemoteJob()
+   *
+   * @return Status and general info for the job requested
+   *
+   * @throws std::invalid_argument If there's an issue with the
+   * job ID
+   *
+   * @throws std::runtime_error If the query fails
+   */
+  virtual RemoteJobInfo queryRemoteJob(const std::string &jobID) const = 0;
+
+  /**
+   * Start a transaction before up/downloading files and submitting
+   * jobs
+   *
+   * @return ID of the transaction as produced by the job scheduler
+   * and/or remote job manager.
+   *
+   * @throws std::runtime_error If the transaction creation fails
+   */
+  virtual std::string startRemoteTransaction() = 0;
+
+  /**
+   * Finish a transaction. This implicitly can cancel all the
+   * operations (jobs) associated with this transaction.
+   *
+   * @param transactionID An Id of a transaction, as returned by
+   * startRemoteTransaction()
+   *
+   * @throws std::invalid_argument If there's an issue with the
+   * transaction ID
+   *
+   * @throws std::runtime_error If the stop operation fails
+   */
+  virtual void stopRemoteTransaction(const std::string &transactionID) = 0;
+
+  /**
+   * Cancel a job (expected to be currently running on the remote resource)
+   *
+   * @param jobID ID for a job in a transaction, as returned by
+   * submitRemoteJob()
+   *
+   * @throws std::invalid_argument If there's an issue with the
+   * job ID
+   * @throws std::runtime_error If the abort/cancel operation fails
+   */
+  virtual void abortRemoteJob(const std::string &jobID) = 0;
+
+  /**
+   * Upload file for a transaction on the rmeote compute resource
+   *
+   * @param transactionID ID, as you get them from
+   * startRemoteTransaction()
+   *
+   * @param remoteFileName Name of file on the (remote) compute
+   * resource. This can be a full or relative path or a simple file
+   * name, depending on implementation.
+   *
+   * @param localFileName Path to the file to upload
+   *
+   * @throws std::invalid_argument If there's an issue with the
+   * arguments passed
+   * @throws std::runtime_error If the upload fails
+   */
+  virtual void uploadRemoteFile(const std::string &transactionID,
+                                const std::string &remoteFileName,
+                                const std::string &localFileName) = 0;
+};
+
+// shared pointer type for the IRemoteJobManager
+typedef boost::shared_ptr<IRemoteJobManager> IRemoteJobManager_sptr;
+
+} // namespace API
+} // namespace Mantid
+
+#endif // MANTID_API_IREMOTEJOBMANAGER_H
diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/RemoteJobManagerFactory.h b/Code/Mantid/Framework/API/inc/MantidAPI/RemoteJobManagerFactory.h
new file mode 100644
index 0000000000000000000000000000000000000000..34fa04176d18cd43e191eb4bf346bdbfdb02b66e
--- /dev/null
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/RemoteJobManagerFactory.h
@@ -0,0 +1,124 @@
+#ifndef MANTID_API_REMOTEJOBMANAGERFACTORY_H_
+#define MANTID_API_REMOTEJOBMANAGERFACTORY_H_
+
+#include "MantidAPI/DllConfig.h"
+#include "MantidAPI/IRemoteJobManager.h"
+#include "MantidKernel/DynamicFactory.h"
+#include "MantidKernel/SingletonHolder.h"
+
+namespace Mantid {
+namespace API {
+/**
+The RemoteJobManagerFactory handles the creation of remote job
+managers specialised for different types of compute resources (for
+different underlying job schedulers, web services, front-ends,
+etc.). Through the create method of this class a shared pointer to a
+remote job manager object can be obtained for a particular compute
+resource.
+
+The remote job managers built by this factory know how to start and
+stop jobs, upload/download files, etc. for the compute resource
+specified when creating the job manager (as long as the compute
+resource is found for the current facility in the facilities
+definition file).
+
+Remote job manager classes must be registered/subscribe using the
+macro DECLARE_REMOTEJOBMANAGER (the same way you use DECLARE_ALGORITHM
+for algorithms and remote algorithms).
+
+As the algorithm, workspace and other factories in Mantid, this
+factory is implemented as a singleton class. Typical usages:
+
+Mantid::API::IRemoteJob|Manager_sptr jobManager =
+    Mantid::API::RemoteJobManagerFactory::Instance().create("Fermi");
+
+Mantid::API::IRemoteJob|Manager_sptr jobManager =
+    Mantid::API::RemoteJobManagerFactory::Instance().create("SCARF@STFC");
+
+
+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>.
+Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+class MANTID_API_DLL RemoteJobManagerFactoryImpl
+    : public Kernel::DynamicFactory<IRemoteJobManager> {
+public:
+  /// Create a remote job manager that will know how to use the
+  /// underlying mechanism that suits the compute resource passed
+  IRemoteJobManager_sptr create(const std::string &computeResourceName) const;
+
+  /// alternative (lower level) create where the specific type of
+  /// manager and base URL are directly given
+  IRemoteJobManager_sptr create(const std::string baseURL,
+                                const std::string jobManagerType) const;
+
+private:
+  /// So that the singleton can be created (cons/destructor are private)
+  friend struct Mantid::Kernel::CreateUsingNew<RemoteJobManagerFactoryImpl>;
+
+  /// Private Constructor for singleton class
+  RemoteJobManagerFactoryImpl();
+  /// Disallow copy construction
+  RemoteJobManagerFactoryImpl(const RemoteJobManagerFactoryImpl &);
+  /// Disallow assignment
+  RemoteJobManagerFactoryImpl &operator=(const RemoteJobManagerFactoryImpl &);
+
+  /// Private Destructor
+  virtual ~RemoteJobManagerFactoryImpl();
+
+  // Unhide the inherited create method but make it private
+  using Kernel::DynamicFactory<IRemoteJobManager>::create;
+};
+
+/// Forward declaration of a specialisation of SingletonHolder for
+/// RemoteJobManagerFactoryImpl (needed for dllexport) and a typedef for it.
+#ifdef _WIN32
+// this breaks new namespace declaraion rules; need to find a better fix
+template class MANTID_API_DLL
+    Mantid::Kernel::SingletonHolder<RemoteJobManagerFactoryImpl>;
+#endif /* _WIN32 */
+
+// The factory is just a specialisation of SingletonHolder
+typedef MANTID_API_DLL Mantid::Kernel::SingletonHolder<
+    RemoteJobManagerFactoryImpl> RemoteJobManagerFactory;
+
+} // namespace API
+} // namespace Mantid
+
+/* Macro to register (remote job manager) classes into the factory. As
+ * with the equivalent macros of the workspace factory or the
+ * algorithm factory, this creates a global object in an anonymous
+ * namespace. The object itself does nothing, but the comma operator
+ * is used in the call to its constructor to effect a call to the
+ * factory's subscribe method.
+ *
+ * You need to use this in every remote job manager. For example:
+ * DECLARE_REMOTEJOBMANAGER(MantidWebServiceAPI)
+ * DECLARE_REMOTEJOBMANAGER(SCARFLSFJobManager)
+ */
+#define DECLARE_REMOTEJOBMANAGER(classname)                                    \
+  namespace {                                                                  \
+  Mantid::Kernel::RegistrationHelper register_ws_##classname(                  \
+      ((Mantid::API::RemoteJobManagerFactory::Instance().subscribe<classname>( \
+           #classname)),                                                       \
+       0));                                                                    \
+  }
+
+#endif // MANTID_API_REMOTEJOBMANAGERFACTORY_H_
diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/ScopedWorkspace.h b/Code/Mantid/Framework/API/inc/MantidAPI/ScopedWorkspace.h
index e379a04431fbf73a8c45f5b989f0596fce19338e..50595222e3f2406b1ca07f36a50f9d181d0a5da5 100644
--- a/Code/Mantid/Framework/API/inc/MantidAPI/ScopedWorkspace.h
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/ScopedWorkspace.h
@@ -74,7 +74,7 @@ public:
   void set(Workspace_sptr newWS);
 
 private:
-  DISABLE_COPY_AND_ASSIGN(ScopedWorkspace);
+  DISABLE_COPY_AND_ASSIGN(ScopedWorkspace)
 
   /// ADS name of the workspace
   const std::string m_name;
diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h b/Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h
index b528bdb6e70991309ac60945f5ba0f501c8e0fc9..97b91a4e7dc1fc4609df364d27ca050548fe7542 100644
--- a/Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h
@@ -48,7 +48,7 @@ enum SCRIPTSTATUS {
   LOCAL_ONLY = (1u << 1),
   REMOTE_CHANGED = (1u << 2),
   LOCAL_CHANGED = (1u << 3),
-  BOTH_CHANGED = (REMOTE_CHANGED | LOCAL_CHANGED),
+  BOTH_CHANGED = (REMOTE_CHANGED | LOCAL_CHANGED)
 };
 
 /**
@@ -610,7 +610,7 @@ public:
 
 /// shared pointer to the function base class
 typedef boost::shared_ptr<ScriptRepository> ScriptRepository_sptr;
-};
-};
+}
+}
 
 #endif // MANTID_API_SCRIPTREPOSITORY_H_
diff --git a/Code/Mantid/Framework/API/src/FunctionParameterDecorator.cpp b/Code/Mantid/Framework/API/src/FunctionParameterDecorator.cpp
index 9c1a1e80045a4060b1fd20a47755ffbaede1ecc4..0f953040eaeea0b03eaf55f861f188feed10f08a 100644
--- a/Code/Mantid/Framework/API/src/FunctionParameterDecorator.cpp
+++ b/Code/Mantid/Framework/API/src/FunctionParameterDecorator.cpp
@@ -37,6 +37,21 @@ IFunction_sptr FunctionParameterDecorator::clone() const {
   return cloned;
 }
 
+void FunctionParameterDecorator::setWorkspace(
+    boost::shared_ptr<const Workspace> ws) {
+  throwIfNoFunctionSet();
+
+  m_wrappedFunction->setWorkspace(ws);
+}
+
+void FunctionParameterDecorator::setMatrixWorkspace(
+    boost::shared_ptr<const MatrixWorkspace> workspace, size_t wi,
+    double startX, double endX) {
+  throwIfNoFunctionSet();
+
+  m_wrappedFunction->setMatrixWorkspace(workspace, wi, startX, endX);
+}
+
 void FunctionParameterDecorator::setParameter(size_t i, const double &value,
                                               bool explicitlySet) {
   throwIfNoFunctionSet();
@@ -91,8 +106,8 @@ double FunctionParameterDecorator::getParameter(const std::string &name) const {
 }
 
 size_t FunctionParameterDecorator::nParams() const {
-  if(!m_wrappedFunction) {
-      return 0;
+  if (!m_wrappedFunction) {
+    return 0;
   }
 
   return m_wrappedFunction->nParams();
@@ -161,8 +176,8 @@ size_t FunctionParameterDecorator::getParameterIndex(
 }
 
 size_t FunctionParameterDecorator::nAttributes() const {
-  if(!m_wrappedFunction) {
-      return 0;
+  if (!m_wrappedFunction) {
+    return 0;
   }
 
   return m_wrappedFunction->nAttributes();
diff --git a/Code/Mantid/Framework/API/src/LinearScale.cpp b/Code/Mantid/Framework/API/src/LinearScale.cpp
index 14d1ff6820dbb9f2d3fe18379098e1dcc641a98c..4d11c0fb96276eec88ab36a6ab73b0f90e16cb8f 100644
--- a/Code/Mantid/Framework/API/src/LinearScale.cpp
+++ b/Code/Mantid/Framework/API/src/LinearScale.cpp
@@ -9,7 +9,7 @@
 namespace Mantid {
 namespace API {
 
-DECLARE_TRANSFORMSCALE(LinearScale);
+DECLARE_TRANSFORMSCALE(LinearScale)
 
 /* Transform the grid to adopt a linear scale
  * @param gd a grid object
diff --git a/Code/Mantid/Framework/API/src/LogManager.cpp b/Code/Mantid/Framework/API/src/LogManager.cpp
index 572043d930322980e1c9a40b1032243fabd119f5..ae405738634e112d9377f3e6505f08a16fa41ca6 100644
--- a/Code/Mantid/Framework/API/src/LogManager.cpp
+++ b/Code/Mantid/Framework/API/src/LogManager.cpp
@@ -434,13 +434,13 @@ void LogManager::clearLogs() { m_manager.clear(); }
   template MANTID_API_DLL TYPE                                                 \
       LogManager::getPropertyValueAsType(const std::string &) const;
 
-INSTANTIATE(double);
-INSTANTIATE(int);
-INSTANTIATE(long);
-INSTANTIATE(uint32_t);
-INSTANTIATE(uint64_t);
-INSTANTIATE(std::string);
-INSTANTIATE(bool);
+INSTANTIATE(double)
+INSTANTIATE(int)
+INSTANTIATE(long)
+INSTANTIATE(uint32_t)
+INSTANTIATE(uint64_t)
+INSTANTIATE(std::string)
+INSTANTIATE(bool)
 
 template MANTID_API_DLL uint16_t
     LogManager::getPropertyValueAsType(const std::string &) const;
diff --git a/Code/Mantid/Framework/API/src/LogarithmScale.cpp b/Code/Mantid/Framework/API/src/LogarithmScale.cpp
index 1ecb35a5d5333f91a48fb66518b20fb3f0d07b44..1e4abfdd83cf4cd95d0c3f74af6ea6d478c86380 100644
--- a/Code/Mantid/Framework/API/src/LogarithmScale.cpp
+++ b/Code/Mantid/Framework/API/src/LogarithmScale.cpp
@@ -16,7 +16,7 @@ namespace {
 Kernel::Logger g_log("LogarithmScale");
 }
 
-DECLARE_TRANSFORMSCALE(LogarithmScale);
+DECLARE_TRANSFORMSCALE(LogarithmScale)
 
 void LogarithmScale::setBase(double &base) {
   if (base <= 0) {
diff --git a/Code/Mantid/Framework/API/src/RemoteJobManagerFactory.cpp b/Code/Mantid/Framework/API/src/RemoteJobManagerFactory.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..744123627a144265173445af3f7b11cd96c3c40a
--- /dev/null
+++ b/Code/Mantid/Framework/API/src/RemoteJobManagerFactory.cpp
@@ -0,0 +1,88 @@
+#include "MantidAPI/RemoteJobManagerFactory.h"
+#include "MantidKernel/ConfigService.h"
+#include "MantidKernel/FacilityInfo.h"
+#include "MantidKernel/Logger.h"
+
+namespace Mantid {
+namespace API {
+namespace {
+/// static logger object
+Kernel::Logger g_log("RemoteJobManagerFactory");
+}
+
+/// Private constructor, singleton class
+RemoteJobManagerFactoryImpl::RemoteJobManagerFactoryImpl()
+    : Mantid::Kernel::DynamicFactory<IRemoteJobManager>() {
+  g_log.debug() << "RemoteJobManager factory created." << std::endl;
+}
+
+/**
+ * Private destructor, prevent client code from using this.
+ */
+RemoteJobManagerFactoryImpl::~RemoteJobManagerFactoryImpl() {}
+
+/**
+ * Create a remote algorithm with the underlying mechanism that suits
+ * the compute resource passed.
+ *
+ * @param computeResourceName Name of a (remote) compute resource
+ *
+ * @throw std::invalid_argument If no resource is found by the name
+ * given (compute resources are looked up in the facilities definition
+ * (XML) file for the current facility.
+ */
+IRemoteJobManager_sptr RemoteJobManagerFactoryImpl::create(
+    const std::string &computeResourceName) const {
+  IRemoteJobManager_sptr jm;
+
+  if (computeResourceName.empty())
+    return jm;
+
+  Mantid::Kernel::ComputeResourceInfo cr =
+      Mantid::Kernel::ConfigService::Instance().getFacility().computeResource(
+          computeResourceName);
+
+  // this is the default. It could be "MantidWebServiceAPI", "LSF",
+  // "SCARFLSF", "MOAB", etc.
+  std::string type = "MantidWebServiceAPIJobManager";
+  std::string fdfType = cr.remoteJobManagerType();
+  if (!fdfType.empty())
+    type = fdfType;
+  return create(cr.baseURL(), type);
+}
+
+/**
+ * Lower level create method that makes a remote algorithm given a
+ * base URL and the type of remote job manager.
+ *
+ * @param baseURL URL where the resource is accessible
+ *
+ * @param jobManagerType Type/class that can handle this remote
+ * compute resource (string names as used in the facilities definition
+ * file, for example: MantidWebServiceAPIJobManager).
+ *
+ * @throw std::invalid_argument If there is an issue with the URL or
+ * the type (for example the type is not recognized).
+ */
+Mantid::API::IRemoteJobManager_sptr
+RemoteJobManagerFactoryImpl::create(const std::string baseURL,
+                                    const std::string jobManagerType) const {
+  Mantid::API::IRemoteJobManager_sptr jm;
+
+  // use the inherited/generic create method
+  try {
+    jm = this->create(jobManagerType);
+  } catch (Kernel::Exception::NotFoundError &e) {
+    throw Kernel::Exception::NotFoundError(
+        "RemoteJobManagerFactory: failed to create a remote job manager of "
+        "type (class) '" +
+            jobManagerType + "' with base URL " + baseURL +
+            ". Error description: " + e.what(),
+        jobManagerType);
+  }
+
+  return jm;
+}
+
+} // namespace API
+} // Namespace Mantid
diff --git a/Code/Mantid/Framework/API/test/CostFunctionFactoryTest.h b/Code/Mantid/Framework/API/test/CostFunctionFactoryTest.h
index c0c567cc8b22d2b6db9917c31b325cad6796ece1..d54b9807c852db41267b21196b5fddf1adaee830 100644
--- a/Code/Mantid/Framework/API/test/CostFunctionFactoryTest.h
+++ b/Code/Mantid/Framework/API/test/CostFunctionFactoryTest.h
@@ -38,7 +38,7 @@ public:
 
 };
 
-DECLARE_COSTFUNCTION(CostFunctionFactoryTest_A, nedtur);
+DECLARE_COSTFUNCTION(CostFunctionFactoryTest_A, nedtur)
 
 
 class CostFunctionFactoryTest : public CxxTest::TestSuite
diff --git a/Code/Mantid/Framework/API/test/FuncMinimizerFactoryTest.h b/Code/Mantid/Framework/API/test/FuncMinimizerFactoryTest.h
index 640b7345c483c0aa039beea8f5973f4884c813ca..2cef42deca31ca5c2d84cfb1fe03ef4e210bf9bb 100644
--- a/Code/Mantid/Framework/API/test/FuncMinimizerFactoryTest.h
+++ b/Code/Mantid/Framework/API/test/FuncMinimizerFactoryTest.h
@@ -33,7 +33,7 @@ public:
   }
 };
 
-DECLARE_FUNCMINIMIZER(FuncMinimizerFactoryTest_A, nedtur);
+DECLARE_FUNCMINIMIZER(FuncMinimizerFactoryTest_A, nedtur)
 
 
 class FuncMinimizerFactoryTest : public CxxTest::TestSuite
diff --git a/Code/Mantid/Framework/API/test/FunctionFactoryTest.h b/Code/Mantid/Framework/API/test/FunctionFactoryTest.h
index 0654f99aca5c3d4e669d0d013428cfc220b60fc0..131988e174f30366b6ae99bcbacf66fe60087bf6 100644
--- a/Code/Mantid/Framework/API/test/FunctionFactoryTest.h
+++ b/Code/Mantid/Framework/API/test/FunctionFactoryTest.h
@@ -134,10 +134,10 @@ public:
 
 };
 
-DECLARE_FUNCTION(FunctionFactoryTest_FunctA);
-DECLARE_FUNCTION(FunctionFactoryTest_FunctB);
-DECLARE_FUNCTION(FunctionFactoryTest_CompFunctA);
-DECLARE_FUNCTION(FunctionFactoryTest_CompFunctB);
+DECLARE_FUNCTION(FunctionFactoryTest_FunctA)
+DECLARE_FUNCTION(FunctionFactoryTest_FunctB)
+DECLARE_FUNCTION(FunctionFactoryTest_CompFunctA)
+DECLARE_FUNCTION(FunctionFactoryTest_CompFunctB)
 
 class FunctionFactoryTest : public CxxTest::TestSuite
 {
diff --git a/Code/Mantid/Framework/API/test/FunctionParameterDecoratorTest.h b/Code/Mantid/Framework/API/test/FunctionParameterDecoratorTest.h
index 4cea527b1a51457ec25804df2501749dc6335f6a..a73c6afee7b5028f02768b94ed58d798d8f535e8 100644
--- a/Code/Mantid/Framework/API/test/FunctionParameterDecoratorTest.h
+++ b/Code/Mantid/Framework/API/test/FunctionParameterDecoratorTest.h
@@ -6,7 +6,9 @@
 #include "MantidAPI/FunctionParameterDecorator.h"
 #include "MantidAPI/ParamFunction.h"
 #include "MantidAPI/FunctionFactory.h"
+#include "MantidAPI/WorkspaceGroup.h"
 #include "MantidKernel/Exception.h"
+
 #include <boost/make_shared.hpp>
 
 #include <gtest/gtest.h>
@@ -44,11 +46,11 @@ public:
   }
 };
 
-DECLARE_FUNCTION(TestableFunctionParameterDecorator);
+DECLARE_FUNCTION(TestableFunctionParameterDecorator)
 
 class FunctionWithParameters : public ParamFunction {
 public:
-  FunctionWithParameters() : ParamFunction() {}
+  FunctionWithParameters() : ParamFunction(), m_workspace() {}
 
   std::string name() const { return "FunctionWithParameters"; }
 
@@ -63,8 +65,15 @@ public:
     UNUSED_ARG(values);
     // Does nothing, not required for this test.
   }
+
+  void setWorkspace(boost::shared_ptr<const Workspace> ws) { m_workspace = ws; }
+
+  Workspace_const_sptr getWorkspace() const { return m_workspace; }
+
+private:
+  Workspace_const_sptr m_workspace;
 };
-DECLARE_FUNCTION(FunctionWithParameters);
+DECLARE_FUNCTION(FunctionWithParameters)
 
 class FunctionWithAttributes : public ParamFunction {
 public:
@@ -88,7 +97,7 @@ public:
   }
 };
 
-DECLARE_FUNCTION(FunctionWithAttributes);
+DECLARE_FUNCTION(FunctionWithAttributes)
 
 class FunctionParameterDecoratorTest : public CxxTest::TestSuite {
 public:
@@ -349,6 +358,25 @@ public:
     TS_ASSERT_EQUALS(cloned->getParameter("Sigma"), 0.3);
   }
 
+  void testSetWorkspace() {
+    // using WorkspaceGroup because it is in API
+    Workspace_const_sptr ws = boost::make_shared<const WorkspaceGroup>();
+
+    TestableFunctionParameterDecorator invalidFn;
+    TS_ASSERT_THROWS(invalidFn.setWorkspace(ws), std::runtime_error);
+
+    FunctionParameterDecorator_sptr fn =
+        getFunctionParameterDecoratorGaussian();
+
+    TS_ASSERT_THROWS_NOTHING(fn->setWorkspace(ws));
+
+    boost::shared_ptr<FunctionWithParameters> decorated =
+        boost::dynamic_pointer_cast<FunctionWithParameters>(
+            fn->getDecoratedFunction());
+
+    TS_ASSERT_EQUALS(decorated->getWorkspace(), ws);
+  }
+
 private:
   FunctionParameterDecorator_sptr getFunctionParameterDecoratorGaussian() {
     FunctionParameterDecorator_sptr fn =
diff --git a/Code/Mantid/Framework/API/test/FunctionPropertyTest.h b/Code/Mantid/Framework/API/test/FunctionPropertyTest.h
index ee488c5a7cdb49d2201bf1d1ffc28f30ae066339..4618e0e2c89c2edb7dea898f3b31d2f4ec5b6404 100644
--- a/Code/Mantid/Framework/API/test/FunctionPropertyTest.h
+++ b/Code/Mantid/Framework/API/test/FunctionPropertyTest.h
@@ -23,7 +23,7 @@ public:
   virtual void function(const FunctionDomain&,FunctionValues&)const {}
 };
 
-DECLARE_FUNCTION(FunctionPropertyTest_Function);
+DECLARE_FUNCTION(FunctionPropertyTest_Function)
 
 class FunctionPropertyTest : public CxxTest::TestSuite
 {
diff --git a/Code/Mantid/Framework/API/test/ImmutableCompositeFunctionTest.h b/Code/Mantid/Framework/API/test/ImmutableCompositeFunctionTest.h
index cf4287e72d71d6ace7541240d6b9a4bd23e5cae6..b3299c9b3567cddb277fca5f8f428c6a1f5fcceb 100644
--- a/Code/Mantid/Framework/API/test/ImmutableCompositeFunctionTest.h
+++ b/Code/Mantid/Framework/API/test/ImmutableCompositeFunctionTest.h
@@ -67,7 +67,7 @@ public:
   std::string name()const {return "ImmutableCompositeFunctionTest_Function";}
 };
 
-DECLARE_FUNCTION(ImmutableCompositeFunctionTest_Function);
+DECLARE_FUNCTION(ImmutableCompositeFunctionTest_Function)
 
 //---------------------------------------------------------------------------------
 class ImmutableCompositeFunctionTest_FunctionWithTies: public ImmutableCompositeFunction
@@ -95,7 +95,7 @@ public:
   std::string name()const {return "ImmutableCompositeFunctionTest_FunctionWithTies";}
 };
 
-DECLARE_FUNCTION(ImmutableCompositeFunctionTest_FunctionWithTies);
+DECLARE_FUNCTION(ImmutableCompositeFunctionTest_FunctionWithTies)
 
 //---------------------------------------------------------------------------------
 class ImmutableCompositeFunctionTest_FunctionThrow: public ImmutableCompositeFunction
diff --git a/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h b/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h
index 38aedd753411f8461f5de26f1ee3dc0159945c98..d3dbf13890143f1021df863049cd37bb33da38e0 100644
--- a/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h
+++ b/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h
@@ -26,7 +26,7 @@ using namespace testing;
 
 
 // Declare into the factory.
-DECLARE_WORKSPACE(WorkspaceTester);
+DECLARE_WORKSPACE(WorkspaceTester)
 
 /** Create a workspace with numSpectra, with
  * each spectrum having one detector, at id = workspace index.
diff --git a/Code/Mantid/Framework/API/test/MultiDomainFunctionTest.h b/Code/Mantid/Framework/API/test/MultiDomainFunctionTest.h
index adf7b610d24711a7b9f21881677d43d44b156570..4e7b1870ec6e8936f7e4e5b365a5332626e8a8f1 100644
--- a/Code/Mantid/Framework/API/test/MultiDomainFunctionTest.h
+++ b/Code/Mantid/Framework/API/test/MultiDomainFunctionTest.h
@@ -49,7 +49,7 @@ protected:
   }
 };
 
-DECLARE_FUNCTION(MultiDomainFunctionTest_Function);
+DECLARE_FUNCTION(MultiDomainFunctionTest_Function)
 
 namespace {
 
diff --git a/Code/Mantid/Framework/API/test/RemoteJobManagerFactoryTest.h b/Code/Mantid/Framework/API/test/RemoteJobManagerFactoryTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..9fa693d8893d48bac960394befb79f17d06bf71b
--- /dev/null
+++ b/Code/Mantid/Framework/API/test/RemoteJobManagerFactoryTest.h
@@ -0,0 +1,149 @@
+#ifndef REMOTEJOBMANAGERFACTORYTEST_H_
+#define REMOTEJOBMANAGERFACTORYTEST_H_
+
+#include "MantidAPI/RemoteJobManagerFactory.h"
+#include "MantidKernel/ConfigService.h"
+#include "MantidKernel/FacilityInfo.h"
+
+using namespace Mantid::API;
+
+// Just a minimal implementation of IRemoteJobManager, sufficient for the
+// factory
+class TestJM : public IRemoteJobManager {
+public:
+  virtual void authenticate(const std::string &username,
+                            const std::string &password) {
+    UNUSED_ARG(username);
+    UNUSED_ARG(password);
+  }
+
+  virtual std::string
+  submitRemoteJob(const std::string &transactionID, const std::string &runnable,
+                  const std::string &param, const std::string &taskName = "",
+                  const int numNodes = 1, const int coresPerNode = 1) {
+    UNUSED_ARG(transactionID);
+    UNUSED_ARG(runnable);
+    UNUSED_ARG(param);
+    UNUSED_ARG(taskName);
+    UNUSED_ARG(numNodes);
+    UNUSED_ARG(coresPerNode);
+    return "";
+  }
+
+  virtual void downloadRemoteFile(const std::string &transactionID,
+                                  const std::string &remoteFileName,
+                                  const std::string &localFileName) {
+    UNUSED_ARG(transactionID);
+    UNUSED_ARG(remoteFileName);
+    UNUSED_ARG(localFileName);
+  }
+
+  virtual std::vector<RemoteJobInfo> queryAllRemoteJobs() const {
+    return std::vector<RemoteJobInfo>();
+  }
+
+  virtual std::vector<std::string>
+  queryRemoteFile(const std::string &transactionID) const {
+    UNUSED_ARG(transactionID);
+    return std::vector<std::string>();
+  }
+
+  virtual RemoteJobInfo queryRemoteJob(const std::string &jobID) const {
+    UNUSED_ARG(jobID);
+    return RemoteJobInfo();
+  }
+
+  virtual std::string startRemoteTransaction() { return ""; }
+
+  virtual void stopRemoteTransaction(const std::string &transactionID) {
+    UNUSED_ARG(transactionID);
+  }
+
+  virtual void abortRemoteJob(const std::string &jobID) { UNUSED_ARG(jobID); }
+
+  virtual void uploadRemoteFile(const std::string &transactionID,
+                                const std::string &remoteFileName,
+                                const std::string &localFileName) {
+    UNUSED_ARG(transactionID);
+    UNUSED_ARG(remoteFileName);
+    UNUSED_ARG(localFileName);
+  }
+};
+
+class RemoteJobManagerFactoryTest : public CxxTest::TestSuite {
+public:
+  void test_unsubscribed() {
+
+    IRemoteJobManager_sptr jobManager;
+    TS_ASSERT_THROWS(
+        jobManager = RemoteJobManagerFactory::Instance().create("Inexistent"),
+        std::runtime_error);
+
+    TS_ASSERT_THROWS(jobManager =
+                         RemoteJobManagerFactory::Instance().create("TestJM"),
+                     std::runtime_error);
+  }
+
+  // minimal positive test
+  void test_createTestJM() {
+    RemoteJobManagerFactory::Instance().subscribe<TestJM>("TestJM");
+    // throws not found cause it is not in facilities.xml, but otherwise fine
+    TS_ASSERT_THROWS(
+        jm = Mantid::API::RemoteJobManagerFactory::Instance().create("TestJM"),
+        Mantid::Kernel::Exception::NotFoundError);
+  }
+
+  // this must fail, resource not found in the current facility
+  void test_createAlienResource() {
+    // save facility, do this before any changes
+    const Mantid::Kernel::FacilityInfo &prevFac =
+        Mantid::Kernel::ConfigService::Instance().getFacility();
+
+    Mantid::Kernel::ConfigService::Instance().setFacility("ISIS");
+    TS_ASSERT_THROWS(
+        jm = Mantid::API::RemoteJobManagerFactory::Instance().create("Fermi"),
+        Mantid::Kernel::Exception::NotFoundError);
+
+    Mantid::Kernel::ConfigService::Instance().setFacility("SNS");
+    TS_ASSERT_THROWS(
+        Mantid::API::IRemoteJobManager_sptr jobManager =
+            Mantid::API::RemoteJobManagerFactory::Instance().create(
+                "SCARF@STFC"),
+        Mantid::Kernel::Exception::NotFoundError);
+
+    // restore facility, always do this at the end
+    Mantid::Kernel::ConfigService::Instance().setFacility(prevFac.name());
+  }
+
+  // a simple positive test
+  void test_createRemoteManagers() {
+    // save facility, do this before any changes
+    const Mantid::Kernel::FacilityInfo &prevFac =
+        Mantid::Kernel::ConfigService::Instance().getFacility();
+
+    Mantid::Kernel::ConfigService::Instance().setFacility("SNS");
+    // TODO: at the moment these two create throw a NotFoundError
+    // because the RemoteJobManager classes are missing and have not
+    // done a DECLARE_REMOTEJOBMANAGER. Change this test when that is
+    // done (ticket #11126 etc.)
+    TS_ASSERT_THROWS(
+        Mantid::API::IRemoteJobManager_sptr jobManager =
+            Mantid::API::RemoteJobManagerFactory::Instance().create("Fermi"),
+        Mantid::Kernel::Exception::NotFoundError);
+
+    Mantid::Kernel::ConfigService::Instance().setFacility("ISIS");
+    TS_ASSERT_THROWS(
+        Mantid::API::IRemoteJobManager_sptr jobManager =
+            Mantid::API::RemoteJobManagerFactory::Instance().create(
+                "SCARF@STFC"),
+        Mantid::Kernel::Exception::NotFoundError);
+
+    // restore facility, always do this at the end
+    Mantid::Kernel::ConfigService::Instance().setFacility(prevFac.name());
+  }
+
+private:
+  Mantid::API::IRemoteJobManager_sptr jm;
+};
+
+#endif /* REMOTEJOBMANAGERFACTORYTEST_H_ */
diff --git a/Code/Mantid/Framework/API/test/VectorParameterParserTest.h b/Code/Mantid/Framework/API/test/VectorParameterParserTest.h
index ece3e673a302aa86190a7f7bb1e686791397c597..305353f12e6433e7d1a774a3e02708e10ab9c3ae 100644
--- a/Code/Mantid/Framework/API/test/VectorParameterParserTest.h
+++ b/Code/Mantid/Framework/API/test/VectorParameterParserTest.h
@@ -94,7 +94,7 @@ public:
     TSM_ASSERT_THROWS("No successor, so should throw!", parser.createParameter(pRootElem), std::runtime_error);
   }
 
-  DECLARE_VECTOR_PARAMETER(SucessorVectorParameter, double);
+  DECLARE_VECTOR_PARAMETER(SucessorVectorParameter, double)
 
   void testChainOfResponsibility()
   {
diff --git a/Code/Mantid/Framework/Algorithms/src/AppendSpectra.cpp b/Code/Mantid/Framework/Algorithms/src/AppendSpectra.cpp
index 6567ccf080c3a8d5506d6f5ef140c1930385a1d2..7c37d7c6e2cb40b7cba7b9cf5a7e3cdd90bcd845 100644
--- a/Code/Mantid/Framework/Algorithms/src/AppendSpectra.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/AppendSpectra.cpp
@@ -23,10 +23,10 @@ AppendSpectra::AppendSpectra() : WorkspaceJoiners() {}
 AppendSpectra::~AppendSpectra() {}
 
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string AppendSpectra::name() const { return "AppendSpectra"; };
+const std::string AppendSpectra::name() const { return "AppendSpectra"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int AppendSpectra::version() const { return 1; };
+int AppendSpectra::version() const { return 1; }
 
 /** Initialize the algorithm's properties.
  */
diff --git a/Code/Mantid/Framework/Algorithms/src/AverageLogData.cpp b/Code/Mantid/Framework/Algorithms/src/AverageLogData.cpp
index 40fa96ee2e9fe32c5a6ce8907e461b0eac7ffe5d..7430a5f108bc389ce1fdb161546632a23342ae76 100644
--- a/Code/Mantid/Framework/Algorithms/src/AverageLogData.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/AverageLogData.cpp
@@ -20,10 +20,10 @@ AverageLogData::~AverageLogData() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string AverageLogData::name() const { return "AverageLogData"; };
+const std::string AverageLogData::name() const { return "AverageLogData"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int AverageLogData::version() const { return 1; };
+int AverageLogData::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string AverageLogData::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/CalculateDIFC.cpp b/Code/Mantid/Framework/Algorithms/src/CalculateDIFC.cpp
index a77fb56a196855d006605f368ce155e3e076e277..8b7b1fcbf156220bf9cd4154b2f5d59d376b7358 100644
--- a/Code/Mantid/Framework/Algorithms/src/CalculateDIFC.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/CalculateDIFC.cpp
@@ -35,7 +35,7 @@ const std::string CalculateDIFC::name() const { return "CalculateDIFC"; }
 /// Algorithm's version for identification. @see Algorithm::version
 int CalculateDIFC::version() const {
   return 1;
-};
+}
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CalculateDIFC::category() const {
@@ -45,7 +45,7 @@ const std::string CalculateDIFC::category() const {
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string CalculateDIFC::summary() const {
   return "Calculate the DIFC for every pixel";
-};
+}
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Code/Mantid/Framework/Algorithms/src/CalculateResolution.cpp b/Code/Mantid/Framework/Algorithms/src/CalculateResolution.cpp
index 51eac3c536bc4914f89856e77a8a1c0c8c8dbc08..a0a8980966416a5a744c5026214cf3c2935a9db1 100644
--- a/Code/Mantid/Framework/Algorithms/src/CalculateResolution.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/CalculateResolution.cpp
@@ -34,10 +34,10 @@ CalculateResolution::~CalculateResolution() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string CalculateResolution::name() const {
   return "CalculateResolution";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CalculateResolution::version() const { return 1; };
+int CalculateResolution::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CalculateResolution::category() const {
@@ -48,7 +48,7 @@ const std::string CalculateResolution::category() const {
 const std::string CalculateResolution::summary() const {
   return "Calculates the reflectometry resolution (dQ/Q) for a given "
          "workspace.";
-};
+}
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Code/Mantid/Framework/Algorithms/src/CalculateSlits.cpp b/Code/Mantid/Framework/Algorithms/src/CalculateSlits.cpp
index 7808595add88994465b14b5c569b5b525a5703fb..b3e4872292cddebc315d3387aebc3d1d6398c8ec 100644
--- a/Code/Mantid/Framework/Algorithms/src/CalculateSlits.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/CalculateSlits.cpp
@@ -28,10 +28,10 @@ CalculateSlits::~CalculateSlits() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string CalculateSlits::name() const {
   return "CalculateSlits";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CalculateSlits::version() const { return 1; };
+int CalculateSlits::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CalculateSlits::category() const {
@@ -41,7 +41,7 @@ const std::string CalculateSlits::category() const {
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string CalculateSlits::summary() const {
   return "Calculates appropriate slit widths for reflectometry instruments.";
-};
+}
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Code/Mantid/Framework/Algorithms/src/ChangeLogTime.cpp b/Code/Mantid/Framework/Algorithms/src/ChangeLogTime.cpp
index 8663e0a329e62384d965adaabd104a56db599aae..a42d58d76769cb5da8fd40d4cbaad43b3d1549cd 100644
--- a/Code/Mantid/Framework/Algorithms/src/ChangeLogTime.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ChangeLogTime.cpp
@@ -7,7 +7,7 @@ namespace Mantid {
 namespace Algorithms {
 
 // Register the algorithm into the AlgorithmFactory
-DECLARE_ALGORITHM(ChangeLogTime);
+DECLARE_ALGORITHM(ChangeLogTime)
 
 using std::string;
 using std::stringstream;
diff --git a/Code/Mantid/Framework/Algorithms/src/ClearInstrumentParameters.cpp b/Code/Mantid/Framework/Algorithms/src/ClearInstrumentParameters.cpp
index 74fc77c9e1d3aface1ff2fbedf61fa3e38e8e003..04c3f06953c48b941a9bc5f62214ff9483e010b1 100644
--- a/Code/Mantid/Framework/Algorithms/src/ClearInstrumentParameters.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ClearInstrumentParameters.cpp
@@ -29,7 +29,7 @@ ClearInstrumentParameters::~ClearInstrumentParameters() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string ClearInstrumentParameters::name() const {
   return "ClearInstrumentParameters";
-};
+}
 
 /// Summary of the algorithm's purpose. @see Algorithm::summary
 const std::string ClearInstrumentParameters::summary() const {
@@ -37,7 +37,7 @@ const std::string ClearInstrumentParameters::summary() const {
 }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ClearInstrumentParameters::version() const { return 1; };
+int ClearInstrumentParameters::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ClearInstrumentParameters::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/ClearMaskFlag.cpp b/Code/Mantid/Framework/Algorithms/src/ClearMaskFlag.cpp
index 71b53a9b1d99c61234c6a27cbfe26addbb64e31f..ba16cd12b7f8044256c751457a1aa14eeb3b6a06 100644
--- a/Code/Mantid/Framework/Algorithms/src/ClearMaskFlag.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ClearMaskFlag.cpp
@@ -21,10 +21,10 @@ ClearMaskFlag::~ClearMaskFlag() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string ClearMaskFlag::name() const { return "ClearMaskFlag"; };
+const std::string ClearMaskFlag::name() const { return "ClearMaskFlag"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ClearMaskFlag::version() const { return 1; };
+int ClearMaskFlag::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ClearMaskFlag::category() const { return "Utility"; }
diff --git a/Code/Mantid/Framework/Algorithms/src/ConvertAxesToRealSpace.cpp b/Code/Mantid/Framework/Algorithms/src/ConvertAxesToRealSpace.cpp
index 6ef693883bb56513353d84f4ed220d3722750a13..0305cd928470fd7a5dcf0d54204b66d680741784 100644
--- a/Code/Mantid/Framework/Algorithms/src/ConvertAxesToRealSpace.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ConvertAxesToRealSpace.cpp
@@ -35,7 +35,7 @@ const std::string ConvertAxesToRealSpace::name() const {
 }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ConvertAxesToRealSpace::version() const { return 1; };
+int ConvertAxesToRealSpace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ConvertAxesToRealSpace::category() const {
@@ -46,7 +46,7 @@ const std::string ConvertAxesToRealSpace::category() const {
 const std::string ConvertAxesToRealSpace::summary() const {
   return "Converts the spectrum and TOF axes to real space values, integrating "
          "the data in the process";
-};
+}
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Code/Mantid/Framework/Algorithms/src/ConvertEmptyToTof.cpp b/Code/Mantid/Framework/Algorithms/src/ConvertEmptyToTof.cpp
index 28bbd9076ecbcf22d92efdc8e57f623dd3f505f1..144171a08a4da4024893ff6003757e3e2ecbf8ee 100644
--- a/Code/Mantid/Framework/Algorithms/src/ConvertEmptyToTof.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ConvertEmptyToTof.cpp
@@ -39,10 +39,10 @@ ConvertEmptyToTof::~ConvertEmptyToTof() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string ConvertEmptyToTof::name() const {
   return "ConvertEmptyToTof";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ConvertEmptyToTof::version() const { return 1; };
+int ConvertEmptyToTof::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ConvertEmptyToTof::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/ConvertToHistogram.cpp b/Code/Mantid/Framework/Algorithms/src/ConvertToHistogram.cpp
index 3b87dc49dbe5d080dbe0b425abbc117cdb715232..37acbb1439ea3462532815b25831d0052ef30db2 100644
--- a/Code/Mantid/Framework/Algorithms/src/ConvertToHistogram.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ConvertToHistogram.cpp
@@ -7,7 +7,7 @@
 namespace Mantid {
 namespace Algorithms {
 
-DECLARE_ALGORITHM(ConvertToHistogram);
+DECLARE_ALGORITHM(ConvertToHistogram)
 
 using API::MatrixWorkspace_sptr;
 using Mantid::MantidVec;
diff --git a/Code/Mantid/Framework/Algorithms/src/ConvertToPointData.cpp b/Code/Mantid/Framework/Algorithms/src/ConvertToPointData.cpp
index ccc2e8ac79b5c8ff788a56868d9e4b32bb49008d..739ca37a9109c93cadafb7bdf95aa4d6e12d1800 100644
--- a/Code/Mantid/Framework/Algorithms/src/ConvertToPointData.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ConvertToPointData.cpp
@@ -7,7 +7,7 @@
 namespace Mantid {
 namespace Algorithms {
 
-DECLARE_ALGORITHM(ConvertToPointData);
+DECLARE_ALGORITHM(ConvertToPointData)
 
 using API::MatrixWorkspace_sptr;
 using Mantid::MantidVec;
diff --git a/Code/Mantid/Framework/Algorithms/src/CopyLogs.cpp b/Code/Mantid/Framework/Algorithms/src/CopyLogs.cpp
index f7aadd28a094c9c05d02f86fd93e9a54df1b33a0..c250b7077847c64fa0d37e3716190dcec0afffdf 100644
--- a/Code/Mantid/Framework/Algorithms/src/CopyLogs.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/CopyLogs.cpp
@@ -23,10 +23,10 @@ CopyLogs::~CopyLogs() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string CopyLogs::name() const { return "CopyLogs"; };
+const std::string CopyLogs::name() const { return "CopyLogs"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CopyLogs::version() const { return 1; };
+int CopyLogs::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CopyLogs::category() const { return "Utility\\Workspaces"; }
diff --git a/Code/Mantid/Framework/Algorithms/src/CreateFlatEventWorkspace.cpp b/Code/Mantid/Framework/Algorithms/src/CreateFlatEventWorkspace.cpp
index f2dc26c177f68fc2ff56e71c025bdf75b46d2e31..525c556bfca688aa7dd33a8c7ee7ecf386cbb0e0 100644
--- a/Code/Mantid/Framework/Algorithms/src/CreateFlatEventWorkspace.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/CreateFlatEventWorkspace.cpp
@@ -25,10 +25,10 @@ CreateFlatEventWorkspace::~CreateFlatEventWorkspace() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string CreateFlatEventWorkspace::name() const {
   return "CreateFlatEventWorkspace";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CreateFlatEventWorkspace::version() const { return 1; };
+int CreateFlatEventWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CreateFlatEventWorkspace::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp b/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp
index 0b665c471eb4a41cf1bce71853622bb3fa61d1f1..0c08dda844cbe54c945b2b9df5569fb1ff425797 100644
--- a/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp
@@ -47,10 +47,10 @@ CreateSampleWorkspace::~CreateSampleWorkspace() { delete m_randGen; }
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string CreateSampleWorkspace::name() const {
   return "CreateSampleWorkspace";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CreateSampleWorkspace::version() const { return 1; };
+int CreateSampleWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CreateSampleWorkspace::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp b/Code/Mantid/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp
index ac913604c97f872015616edfd73bf1bb67a5371b..2b7b6da122750c306b499535f4028362fcaf0a29 100644
--- a/Code/Mantid/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp
@@ -32,10 +32,10 @@ CreateTransmissionWorkspace::~CreateTransmissionWorkspace() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string CreateTransmissionWorkspace::name() const {
   return "CreateTransmissionWorkspace";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CreateTransmissionWorkspace::version() const { return 1; };
+int CreateTransmissionWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CreateTransmissionWorkspace::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/DeleteWorkspace.cpp b/Code/Mantid/Framework/Algorithms/src/DeleteWorkspace.cpp
index 329b737da1923c24e6b4b8c493b03253961dcc37..7cb53d9b5af47c1ef13374b3de1e1101bd04fea7 100644
--- a/Code/Mantid/Framework/Algorithms/src/DeleteWorkspace.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/DeleteWorkspace.cpp
@@ -8,7 +8,7 @@ namespace Mantid {
 namespace Algorithms {
 
 // Register the algorithm
-DECLARE_ALGORITHM(DeleteWorkspace);
+DECLARE_ALGORITHM(DeleteWorkspace)
 
 //--------------------------------------------------------------------------
 // Private member functions
diff --git a/Code/Mantid/Framework/Algorithms/src/DetectorDiagnostic.cpp b/Code/Mantid/Framework/Algorithms/src/DetectorDiagnostic.cpp
index 2b6ab8e2618e18c0dcd1df852bc7105428b10d3c..35dafe442d1123b564500d52c744a7b9fa1489de 100644
--- a/Code/Mantid/Framework/Algorithms/src/DetectorDiagnostic.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/DetectorDiagnostic.cpp
@@ -737,6 +737,6 @@ double DetectorDiagnostic::advanceProgress(double toAdd) {
 void DetectorDiagnostic::failProgress(RunTime aborted) {
   advanceProgress(-aborted);
   m_TotalTime -= aborted;
-};
+}
 }
 }
diff --git a/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCorUser.cpp b/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCorUser.cpp
index 4c92103f327c915a79fa3e498c7280ce2783f63c..559a747688bc1e561cf4550995d40415d180174a 100644
--- a/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCorUser.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCorUser.cpp
@@ -29,10 +29,10 @@ DetectorEfficiencyCorUser::~DetectorEfficiencyCorUser() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string DetectorEfficiencyCorUser::name() const {
   return "DetectorEfficiencyCorUser";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int DetectorEfficiencyCorUser::version() const { return 1; };
+int DetectorEfficiencyCorUser::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string DetectorEfficiencyCorUser::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/FilterByXValue.cpp b/Code/Mantid/Framework/Algorithms/src/FilterByXValue.cpp
index a73f536d6edfcd52d45523298f83865f50d31172..29a8be14083c59ce77e8d373ef3335834a0a5ea7 100644
--- a/Code/Mantid/Framework/Algorithms/src/FilterByXValue.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/FilterByXValue.cpp
@@ -17,9 +17,9 @@ FilterByXValue::FilterByXValue() {}
 FilterByXValue::~FilterByXValue() {}
 
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string FilterByXValue::name() const { return "FilterByXValue"; };
+const std::string FilterByXValue::name() const { return "FilterByXValue"; }
 /// Algorithm's version for identification. @see Algorithm::version
-int FilterByXValue::version() const { return 1; };
+int FilterByXValue::version() const { return 1; }
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string FilterByXValue::category() const {
   return "Events\\EventFiltering";
diff --git a/Code/Mantid/Framework/Algorithms/src/GroupWorkspaces.cpp b/Code/Mantid/Framework/Algorithms/src/GroupWorkspaces.cpp
index fd55a82efa033b870456698cb54bcdb7ea395ecb..110b07a9e15adb4491cc1a95cbe344cf3f23d8f8 100644
--- a/Code/Mantid/Framework/Algorithms/src/GroupWorkspaces.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/GroupWorkspaces.cpp
@@ -7,7 +7,7 @@
 namespace Mantid {
 namespace Algorithms {
 
-DECLARE_ALGORITHM(GroupWorkspaces);
+DECLARE_ALGORITHM(GroupWorkspaces)
 
 using namespace Kernel;
 using namespace API;
diff --git a/Code/Mantid/Framework/Algorithms/src/IntegrateByComponent.cpp b/Code/Mantid/Framework/Algorithms/src/IntegrateByComponent.cpp
index f5e1a98e61b37a35ff1fa027cfb445a165ff1ed3..3736939ef44d5308342132576d077262bd22c1a5 100644
--- a/Code/Mantid/Framework/Algorithms/src/IntegrateByComponent.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/IntegrateByComponent.cpp
@@ -25,10 +25,10 @@ IntegrateByComponent::~IntegrateByComponent() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string IntegrateByComponent::name() const {
   return "IntegrateByComponent";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int IntegrateByComponent::version() const { return 1; };
+int IntegrateByComponent::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string IntegrateByComponent::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/LorentzCorrection.cpp b/Code/Mantid/Framework/Algorithms/src/LorentzCorrection.cpp
index 0100a0000efc59c6f46b67a98744db4476520d9a..2d42cd4b7ccfccc6e28dfd1c2dbd4103ab9fb745 100644
--- a/Code/Mantid/Framework/Algorithms/src/LorentzCorrection.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/LorentzCorrection.cpp
@@ -31,7 +31,7 @@ LorentzCorrection::~LorentzCorrection() {}
 //----------------------------------------------------------------------------------------------
 
 /// Algorithm's version for identification. @see Algorithm::version
-int LorentzCorrection::version() const { return 1; };
+int LorentzCorrection::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string LorentzCorrection::category() const { return "Crystal"; }
@@ -39,7 +39,7 @@ const std::string LorentzCorrection::category() const { return "Crystal"; }
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string LorentzCorrection::summary() const {
   return "Performs a white beam Lorentz Correction";
-};
+}
 
 const std::string LorentzCorrection::name() const {
   return "LorentzCorrection";
diff --git a/Code/Mantid/Framework/Algorithms/src/MedianDetectorTest.cpp b/Code/Mantid/Framework/Algorithms/src/MedianDetectorTest.cpp
index db2e7c678a22d16a0b612aaebd87c890ab344e01..a6798977247cb4b40b811f4c0e7df63406af6847 100644
--- a/Code/Mantid/Framework/Algorithms/src/MedianDetectorTest.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/MedianDetectorTest.cpp
@@ -19,7 +19,7 @@ using namespace Geometry;
 MedianDetectorTest::MedianDetectorTest()
     : DetectorDiagnostic(), m_inputWS(), m_loFrac(0.1), m_hiFrac(1.5),
       m_minSpec(0), m_maxSpec(EMPTY_INT()), m_rangeLower(0.0),
-      m_rangeUpper(0.0){};
+      m_rangeUpper(0.0){}
 
 const std::string MedianDetectorTest::category() const { return "Diagnostics"; }
 
diff --git a/Code/Mantid/Framework/Algorithms/src/ModeratorTzero.cpp b/Code/Mantid/Framework/Algorithms/src/ModeratorTzero.cpp
index 36224d81a0e9b70fbd1effe9d12edc1b6a5b3b5d..c7a22c2a163256a76b46dd8a990492c1abc5a1f1 100644
--- a/Code/Mantid/Framework/Algorithms/src/ModeratorTzero.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ModeratorTzero.cpp
@@ -14,7 +14,7 @@ namespace Mantid {
 namespace Algorithms {
 
 // Register the algorithm into the AlgorithmFactory
-DECLARE_ALGORITHM(ModeratorTzero);
+DECLARE_ALGORITHM(ModeratorTzero)
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
diff --git a/Code/Mantid/Framework/Algorithms/src/MuonGroupDetectors.cpp b/Code/Mantid/Framework/Algorithms/src/MuonGroupDetectors.cpp
index b1d711f7e208823eac0dd0552ba481c13838ff39..105188cee04e4f7794ab05415807019397dac28f 100644
--- a/Code/Mantid/Framework/Algorithms/src/MuonGroupDetectors.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/MuonGroupDetectors.cpp
@@ -26,10 +26,10 @@ MuonGroupDetectors::~MuonGroupDetectors() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string MuonGroupDetectors::name() const {
   return "MuonGroupDetectors";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int MuonGroupDetectors::version() const { return 1; };
+int MuonGroupDetectors::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string MuonGroupDetectors::category() const { return "Muon"; }
diff --git a/Code/Mantid/Framework/Algorithms/src/NormaliseByDetector.cpp b/Code/Mantid/Framework/Algorithms/src/NormaliseByDetector.cpp
index 3c4cfc0867cd45227d302ff1bc2c726b0007d5e3..97e2ee6a72ee2c4ce3bddd1cb8b9f1af6f8a61b9 100644
--- a/Code/Mantid/Framework/Algorithms/src/NormaliseByDetector.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/NormaliseByDetector.cpp
@@ -39,10 +39,10 @@ NormaliseByDetector::~NormaliseByDetector() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string NormaliseByDetector::name() const {
   return "NormaliseByDetector";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int NormaliseByDetector::version() const { return 1; };
+int NormaliseByDetector::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string NormaliseByDetector::category() const {
@@ -199,7 +199,7 @@ NormaliseByDetector::processHistograms(MatrixWorkspace_sptr inWS) {
   }
 
   return denominatorWS;
-};
+}
 
 //----------------------------------------------------------------------------------------------
 /** Execute the algorithm.
diff --git a/Code/Mantid/Framework/Algorithms/src/Pause.cpp b/Code/Mantid/Framework/Algorithms/src/Pause.cpp
index 007f5e10f8dd170a935eca1e53988155e13c11f4..170559caff20115e7cbdc320bd1661fff5aa418d 100644
--- a/Code/Mantid/Framework/Algorithms/src/Pause.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/Pause.cpp
@@ -24,10 +24,10 @@ Pause::~Pause() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string Pause::name() const { return "Pause"; };
+const std::string Pause::name() const { return "Pause"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int Pause::version() const { return 1; };
+int Pause::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string Pause::category() const { return "Utility\\Development"; }
diff --git a/Code/Mantid/Framework/Algorithms/src/PerformIndexOperations.cpp b/Code/Mantid/Framework/Algorithms/src/PerformIndexOperations.cpp
index 3a8fb0f7dd754c470699eed9ebe88c7854eb74ff..a3d760f3e67e301a0fef2bc41a1c0346fec13bc5 100644
--- a/Code/Mantid/Framework/Algorithms/src/PerformIndexOperations.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/PerformIndexOperations.cpp
@@ -268,10 +268,10 @@ PerformIndexOperations::~PerformIndexOperations() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string PerformIndexOperations::name() const {
   return "PerformIndexOperations";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int PerformIndexOperations::version() const { return 1; };
+int PerformIndexOperations::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string PerformIndexOperations::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/PolarizationCorrection.cpp b/Code/Mantid/Framework/Algorithms/src/PolarizationCorrection.cpp
index b2a1760dd6fc0996ab6d2d473123f7d9bb536224..4a9ef9b303a1f28ba5b1f2cac7ad778853fffc73 100644
--- a/Code/Mantid/Framework/Algorithms/src/PolarizationCorrection.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/PolarizationCorrection.cpp
@@ -119,10 +119,10 @@ PolarizationCorrection::~PolarizationCorrection() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string PolarizationCorrection::name() const {
   return "PolarizationCorrection";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int PolarizationCorrection::version() const { return 1; };
+int PolarizationCorrection::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string PolarizationCorrection::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/RebinByPulseTimes.cpp b/Code/Mantid/Framework/Algorithms/src/RebinByPulseTimes.cpp
index 2bbe560658f4b97186cfeb60b1a08292dd0940e9..fce9355eb4d9257196073111df03d062ad9d68d7 100644
--- a/Code/Mantid/Framework/Algorithms/src/RebinByPulseTimes.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/RebinByPulseTimes.cpp
@@ -29,10 +29,10 @@ RebinByPulseTimes::~RebinByPulseTimes() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string RebinByPulseTimes::name() const {
   return "RebinByPulseTimes";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int RebinByPulseTimes::version() const { return 1; };
+int RebinByPulseTimes::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string RebinByPulseTimes::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/RebinByTimeAtSample.cpp b/Code/Mantid/Framework/Algorithms/src/RebinByTimeAtSample.cpp
index c7d3f0491c987b7a93139e6347725ab34d14e17c..ff2234d2fec9fa9a206c1d2ecf0220f1f2512215 100644
--- a/Code/Mantid/Framework/Algorithms/src/RebinByTimeAtSample.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/RebinByTimeAtSample.cpp
@@ -28,7 +28,7 @@ RebinByTimeAtSample::~RebinByTimeAtSample() {}
 //----------------------------------------------------------------------------------------------
 
 /// Algorithm's version for identification. @see Algorithm::version
-int RebinByTimeAtSample::version() const { return 1; };
+int RebinByTimeAtSample::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string RebinByTimeAtSample::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOne.cpp b/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOne.cpp
index ab6ebf78f1ac94f41706b0da58a3857a243705bc..dfb1a2932196bc442fc5ce1046f0f5e833edd8ba 100644
--- a/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOne.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOne.cpp
@@ -95,10 +95,10 @@ ReflectometryReductionOne::~ReflectometryReductionOne() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string ReflectometryReductionOne::name() const {
   return "ReflectometryReductionOne";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ReflectometryReductionOne::version() const { return 1; };
+int ReflectometryReductionOne::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ReflectometryReductionOne::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOneAuto.cpp b/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOneAuto.cpp
index f29229096e23610e97eb7e73efc03b43904d4027..884848559d96a6bdeddd81e471ca0d54f71c3b69 100644
--- a/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOneAuto.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOneAuto.cpp
@@ -31,10 +31,10 @@ ReflectometryReductionOneAuto::~ReflectometryReductionOneAuto() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string ReflectometryReductionOneAuto::name() const {
   return "ReflectometryReductionOneAuto";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ReflectometryReductionOneAuto::version() const { return 1; };
+int ReflectometryReductionOneAuto::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ReflectometryReductionOneAuto::category() const {
@@ -45,7 +45,7 @@ const std::string ReflectometryReductionOneAuto::category() const {
 const std::string ReflectometryReductionOneAuto::summary() const {
   return "Reduces a single TOF/Lambda reflectometry run into a mod Q vs I/I0 "
          "workspace. Performs transmission corrections.";
-};
+}
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Code/Mantid/Framework/Algorithms/src/RemoveBackground.cpp b/Code/Mantid/Framework/Algorithms/src/RemoveBackground.cpp
index 706570edca1093be8f5d0ff5f10a119e0434ca31..8601d1e2c38ec13f727d1200424e329797326ea0 100644
--- a/Code/Mantid/Framework/Algorithms/src/RemoveBackground.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/RemoveBackground.cpp
@@ -150,7 +150,7 @@ void RemoveBackground::exec() {
 BackgroundHelper::BackgroundHelper()
     : m_WSUnit(), m_bgWs(), m_wkWS(), m_pgLog(NULL), m_inPlace(true),
       m_singleValueBackground(false), m_NBg(0), m_dtBg(1), // m_ErrSq(0),
-      m_Emode(0), m_L1(0), m_Efix(0), m_Sample(){};
+      m_Emode(0), m_L1(0), m_Efix(0), m_Sample(){}
 /// Destructor
 BackgroundHelper::~BackgroundHelper() { this->deleteUnitsConverters(); }
 
diff --git a/Code/Mantid/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp b/Code/Mantid/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp
index 8d30c4fa14d1734998002801366360dbcddc76a4..4d6ecc74b7c086e20ae676fb58379e41b5325b97 100644
--- a/Code/Mantid/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp
@@ -24,10 +24,10 @@ RemoveWorkspaceHistory::~RemoveWorkspaceHistory() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string RemoveWorkspaceHistory::name() const {
   return "RemoveWorkspaceHistory";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int RemoveWorkspaceHistory::version() const { return 1; };
+int RemoveWorkspaceHistory::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string RemoveWorkspaceHistory::category() const { return "Utility"; }
@@ -35,7 +35,7 @@ const std::string RemoveWorkspaceHistory::category() const { return "Utility"; }
 /// Algorithm's summary for identification. @see Algorithm::summary
 const std::string RemoveWorkspaceHistory::summary() const {
   return "Removes all algorithm history records from a given workspace.";
-};
+}
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Code/Mantid/Framework/Algorithms/src/ResizeRectangularDetector.cpp b/Code/Mantid/Framework/Algorithms/src/ResizeRectangularDetector.cpp
index bb719da642518b5ff56a3da0302eac25d3f2aab6..d5c40de7a071562011e9a415651980c7a7db93b7 100644
--- a/Code/Mantid/Framework/Algorithms/src/ResizeRectangularDetector.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ResizeRectangularDetector.cpp
@@ -30,10 +30,10 @@ ResizeRectangularDetector::~ResizeRectangularDetector() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string ResizeRectangularDetector::name() const {
   return "ResizeRectangularDetector";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ResizeRectangularDetector::version() const { return 1; };
+int ResizeRectangularDetector::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ResizeRectangularDetector::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/RingProfile.cpp b/Code/Mantid/Framework/Algorithms/src/RingProfile.cpp
index b558c1a8584d161ed8d94c5021e3521891d38a4d..21be96faae17a952d49631c3fe09579a7dfd9de7 100644
--- a/Code/Mantid/Framework/Algorithms/src/RingProfile.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/RingProfile.cpp
@@ -582,7 +582,7 @@ void RingProfile::getBinForPixel(const API::MatrixWorkspace_sptr ws,
     // call fromAngleToBin (radians)
     bins_pos[i] = fromAngleToBin(angle, false);
   }
-};
+}
 
 /* Return the bin position for a given angle.
  *
@@ -618,7 +618,7 @@ int RingProfile::fromAngleToBin(double angle, bool degree) {
 
   angle /= bin_size;
   return (int)angle;
-};
+}
 
 } // namespace Algorithms
 } // namespace Mantid
diff --git a/Code/Mantid/Framework/Algorithms/src/SassenaFFT.cpp b/Code/Mantid/Framework/Algorithms/src/SassenaFFT.cpp
index c51071190ef9622f8ec8b788cef21823f9254449..bd0e048fd71389869f0d3dd824806f8bb0eb901a 100644
--- a/Code/Mantid/Framework/Algorithms/src/SassenaFFT.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/SassenaFFT.cpp
@@ -13,7 +13,7 @@ namespace Mantid {
 namespace Algorithms {
 
 // Register the class into the algorithm factory
-DECLARE_ALGORITHM(SassenaFFT);
+DECLARE_ALGORITHM(SassenaFFT)
 
 /// Override Algorithm::checkGroups
 bool SassenaFFT::checkGroups() { return false; }
diff --git a/Code/Mantid/Framework/Algorithms/src/SetInstrumentParameter.cpp b/Code/Mantid/Framework/Algorithms/src/SetInstrumentParameter.cpp
index 487d95665918268f99bc46e476c81055492c54f1..e06d9b1f72eb441cf90572f88ff4e4551f7db4a2 100644
--- a/Code/Mantid/Framework/Algorithms/src/SetInstrumentParameter.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/SetInstrumentParameter.cpp
@@ -30,10 +30,10 @@ SetInstrumentParameter::~SetInstrumentParameter() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string SetInstrumentParameter::name() const {
   return "SetInstrumentParameter";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int SetInstrumentParameter::version() const { return 1; };
+int SetInstrumentParameter::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string SetInstrumentParameter::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/SignalOverError.cpp b/Code/Mantid/Framework/Algorithms/src/SignalOverError.cpp
index 2354d0369c331ebc12301081d613c8edebafe971..9d36340512c7e2d896b13d5280fa570ff412d6ed 100644
--- a/Code/Mantid/Framework/Algorithms/src/SignalOverError.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/SignalOverError.cpp
@@ -25,10 +25,10 @@ SignalOverError::~SignalOverError() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string SignalOverError::name() const { return "SignalOverError"; };
+const std::string SignalOverError::name() const { return "SignalOverError"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int SignalOverError::version() const { return 1; };
+int SignalOverError::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string SignalOverError::category() const { return "Arithmetic"; }
diff --git a/Code/Mantid/Framework/Algorithms/src/SpecularReflectionCalculateTheta.cpp b/Code/Mantid/Framework/Algorithms/src/SpecularReflectionCalculateTheta.cpp
index 917f3aa741e17ea02c5cbf86e0361f10468ac507..ac7c575361fcc7908661d91c07170dd0c3ddfb63 100644
--- a/Code/Mantid/Framework/Algorithms/src/SpecularReflectionCalculateTheta.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/SpecularReflectionCalculateTheta.cpp
@@ -35,10 +35,10 @@ SpecularReflectionCalculateTheta::~SpecularReflectionCalculateTheta() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string SpecularReflectionCalculateTheta::name() const {
   return "SpecularReflectionCalculateTheta";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int SpecularReflectionCalculateTheta::version() const { return 1; };
+int SpecularReflectionCalculateTheta::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string SpecularReflectionCalculateTheta::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/SpecularReflectionPositionCorrect.cpp b/Code/Mantid/Framework/Algorithms/src/SpecularReflectionPositionCorrect.cpp
index b69a6128a5e1a1ed2db63c9a09233408bc16f782..3497a23d437b317b942c9f2da90897a1a40f95f5 100644
--- a/Code/Mantid/Framework/Algorithms/src/SpecularReflectionPositionCorrect.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/SpecularReflectionPositionCorrect.cpp
@@ -70,10 +70,10 @@ SpecularReflectionPositionCorrect::~SpecularReflectionPositionCorrect() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string SpecularReflectionPositionCorrect::name() const {
   return "SpecularReflectionPositionCorrect";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int SpecularReflectionPositionCorrect::version() const { return 1; };
+int SpecularReflectionPositionCorrect::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string SpecularReflectionPositionCorrect::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/SumEventsByLogValue.cpp b/Code/Mantid/Framework/Algorithms/src/SumEventsByLogValue.cpp
index 7829bd0452a0062659720df8f9e6a9b34a1b4c62..48f47cff4a6f2b0af50d291e0cf097fc4f95d5ae 100644
--- a/Code/Mantid/Framework/Algorithms/src/SumEventsByLogValue.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/SumEventsByLogValue.cpp
@@ -10,7 +10,7 @@
 namespace Mantid {
 namespace Algorithms {
 // Register the class into the algorithm factory
-DECLARE_ALGORITHM(SumEventsByLogValue);
+DECLARE_ALGORITHM(SumEventsByLogValue)
 
 using namespace Kernel;
 using namespace API;
diff --git a/Code/Mantid/Framework/Algorithms/src/UpdateScriptRepository.cpp b/Code/Mantid/Framework/Algorithms/src/UpdateScriptRepository.cpp
index b56a1c0be37fa8991388e2e5a10a3596f115e142..45e620542ce14a6f0d2a28b3e1af3f2bdea1df28 100644
--- a/Code/Mantid/Framework/Algorithms/src/UpdateScriptRepository.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/UpdateScriptRepository.cpp
@@ -22,10 +22,10 @@ UpdateScriptRepository::~UpdateScriptRepository() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string UpdateScriptRepository::name() const {
   return "UpdateScriptRepository";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int UpdateScriptRepository::version() const { return 1; };
+int UpdateScriptRepository::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string UpdateScriptRepository::category() const { return "Utility"; }
diff --git a/Code/Mantid/Framework/Algorithms/src/WeightedMeanOfWorkspace.cpp b/Code/Mantid/Framework/Algorithms/src/WeightedMeanOfWorkspace.cpp
index baf8f5094140f906c9a723410d0d4feb6c73c7ad..4703eb91d2f8810ff1dca33cc95c7f8986bf8c3f 100644
--- a/Code/Mantid/Framework/Algorithms/src/WeightedMeanOfWorkspace.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/WeightedMeanOfWorkspace.cpp
@@ -28,10 +28,10 @@ WeightedMeanOfWorkspace::~WeightedMeanOfWorkspace() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string WeightedMeanOfWorkspace::name() const {
   return "WeightedMeanOfWorkspace";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int WeightedMeanOfWorkspace::version() const { return 1; };
+int WeightedMeanOfWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string WeightedMeanOfWorkspace::category() const {
diff --git a/Code/Mantid/Framework/Algorithms/src/WeightingStrategy.cpp b/Code/Mantid/Framework/Algorithms/src/WeightingStrategy.cpp
index f09fd1e6658301afb71350742d40198d5d2cd409..17af7d37dedeb47c3456953a01de9ac1f730c51c 100644
--- a/Code/Mantid/Framework/Algorithms/src/WeightingStrategy.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/WeightingStrategy.cpp
@@ -15,10 +15,10 @@ namespace Algorithms {
 Constructor
 @param cutOff : radius cutoff
 */
-WeightingStrategy::WeightingStrategy(const double cutOff) : m_cutOff(cutOff){};
+WeightingStrategy::WeightingStrategy(const double cutOff) : m_cutOff(cutOff){}
 
 /// Constructor
-WeightingStrategy::WeightingStrategy() : m_cutOff(0){};
+WeightingStrategy::WeightingStrategy() : m_cutOff(0){}
 
 /// Destructor
 WeightingStrategy::~WeightingStrategy() {}
diff --git a/Code/Mantid/Framework/Algorithms/src/WienerSmooth.cpp b/Code/Mantid/Framework/Algorithms/src/WienerSmooth.cpp
index e4baaba6d2b072c91d6a7f4777a8fd2dfb70f7b1..f8762cd5a56678a9a521549a927a4684964050e1 100644
--- a/Code/Mantid/Framework/Algorithms/src/WienerSmooth.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/WienerSmooth.cpp
@@ -38,7 +38,7 @@ WienerSmooth::~WienerSmooth() {}
 //----------------------------------------------------------------------------------------------
 
 /// Algorithm's version for identification. @see Algorithm::version
-int WienerSmooth::version() const { return 1; };
+int WienerSmooth::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string WienerSmooth::category() const {
@@ -48,7 +48,7 @@ const std::string WienerSmooth::category() const {
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string WienerSmooth::summary() const {
   return "Smooth spectra using Wiener filter.";
-};
+}
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Code/Mantid/Framework/Algorithms/test/PolarizationCorrectionTest.h b/Code/Mantid/Framework/Algorithms/test/PolarizationCorrectionTest.h
index ea8ebf25defd3f47972f3316b709369c6b90be9c..e1c508f642497a2edf88ad230a6d6979d26cffec 100644
--- a/Code/Mantid/Framework/Algorithms/test/PolarizationCorrectionTest.h
+++ b/Code/Mantid/Framework/Algorithms/test/PolarizationCorrectionTest.h
@@ -178,6 +178,7 @@ public:
       checkAlg->setChild(true);
       checkAlg->setProperty("Workspace1", groupWS->getItem(i));
       checkAlg->setProperty("Workspace2", outWS->getItem(i));
+      checkAlg->setProperty("Tolerance", 3e-16);
       checkAlg->execute();
       const std::string result = checkAlg->getProperty("Result");
       TS_ASSERT_EQUALS("Success!", result);
diff --git a/Code/Mantid/Framework/Crystal/src/AddPeakHKL.cpp b/Code/Mantid/Framework/Crystal/src/AddPeakHKL.cpp
index 78c563d096e9f80d630d3277b441317c5236f09b..2e770043c2b4c4322cbbe4bf855d2b08f1ab60d6 100644
--- a/Code/Mantid/Framework/Crystal/src/AddPeakHKL.cpp
+++ b/Code/Mantid/Framework/Crystal/src/AddPeakHKL.cpp
@@ -39,13 +39,13 @@ namespace Crystal
   const std::string AddPeakHKL::name() const { return "AddPeakHKL"; }
 
   /// Algorithm's version for identification. @see Algorithm::version
-  int AddPeakHKL::version() const { return 1;};
+  int AddPeakHKL::version() const { return 1;}
 
   /// Algorithm's category for identification. @see Algorithm::category
   const std::string AddPeakHKL::category() const { return "Crystal";}
 
   /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
-  const std::string AddPeakHKL::summary() const { return "Add a peak in the hkl frame";};
+  const std::string AddPeakHKL::summary() const { return "Add a peak in the hkl frame";}
 
   //----------------------------------------------------------------------------------------------
   /** Initialize the algorithm's properties.
diff --git a/Code/Mantid/Framework/Crystal/src/CalculatePeaksHKL.cpp b/Code/Mantid/Framework/Crystal/src/CalculatePeaksHKL.cpp
index 46cac8737cdf810c0726e162dccaeca34d9b3322..10dc1653c945a9b9165be5748d7aec67bd2cc759 100644
--- a/Code/Mantid/Framework/Crystal/src/CalculatePeaksHKL.cpp
+++ b/Code/Mantid/Framework/Crystal/src/CalculatePeaksHKL.cpp
@@ -30,10 +30,10 @@ CalculatePeaksHKL::~CalculatePeaksHKL() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string CalculatePeaksHKL::name() const {
   return "CalculatePeaksHKL";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CalculatePeaksHKL::version() const { return 1; };
+int CalculatePeaksHKL::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CalculatePeaksHKL::category() const { return "Crystal"; }
diff --git a/Code/Mantid/Framework/Crystal/src/ClearUB.cpp b/Code/Mantid/Framework/Crystal/src/ClearUB.cpp
index fdcefa2a8939f31d66ae57874d1f3c960086a577..54f27de7e263aa9c44a2aee4fd43a3c5fd5f17ee 100644
--- a/Code/Mantid/Framework/Crystal/src/ClearUB.cpp
+++ b/Code/Mantid/Framework/Crystal/src/ClearUB.cpp
@@ -22,10 +22,10 @@ ClearUB::~ClearUB() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string ClearUB::name() const { return "ClearUB"; };
+const std::string ClearUB::name() const { return "ClearUB"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ClearUB::version() const { return 1; };
+int ClearUB::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ClearUB::category() const { return "Crystal"; }
diff --git a/Code/Mantid/Framework/Crystal/src/CombinePeaksWorkspaces.cpp b/Code/Mantid/Framework/Crystal/src/CombinePeaksWorkspaces.cpp
index f59b28b0a0afec6d2bccc69d407f01d1c286392f..e4e518348f73a2af6d0618fe8d555587157fbcff 100644
--- a/Code/Mantid/Framework/Crystal/src/CombinePeaksWorkspaces.cpp
+++ b/Code/Mantid/Framework/Crystal/src/CombinePeaksWorkspaces.cpp
@@ -27,9 +27,9 @@ CombinePeaksWorkspaces::~CombinePeaksWorkspaces() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string CombinePeaksWorkspaces::name() const {
   return "CombinePeaksWorkspaces";
-};
+}
 /// Algorithm's version for identification. @see Algorithm::version
-int CombinePeaksWorkspaces::version() const { return 1; };
+int CombinePeaksWorkspaces::version() const { return 1; }
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CombinePeaksWorkspaces::category() const { return "Crystal"; }
 
diff --git a/Code/Mantid/Framework/Crystal/src/DiffPeaksWorkspaces.cpp b/Code/Mantid/Framework/Crystal/src/DiffPeaksWorkspaces.cpp
index 00a3cb839e66ac218354ba7d9b2d0ac266d6ed87..34337d74f916b5f752f209cd46e81ab1639e2530 100644
--- a/Code/Mantid/Framework/Crystal/src/DiffPeaksWorkspaces.cpp
+++ b/Code/Mantid/Framework/Crystal/src/DiffPeaksWorkspaces.cpp
@@ -25,9 +25,9 @@ DiffPeaksWorkspaces::~DiffPeaksWorkspaces() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string DiffPeaksWorkspaces::name() const {
   return "DiffPeaksWorkspaces";
-};
+}
 /// Algorithm's version for identification. @see Algorithm::version
-int DiffPeaksWorkspaces::version() const { return 1; };
+int DiffPeaksWorkspaces::version() const { return 1; }
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string DiffPeaksWorkspaces::category() const { return "Crystal"; }
 
diff --git a/Code/Mantid/Framework/Crystal/src/FilterPeaks.cpp b/Code/Mantid/Framework/Crystal/src/FilterPeaks.cpp
index efecf7a037a398f7f6a04f7dc48d4b189bde7b5f..86ff9a78ccc89431627d17f7fec913511e499924 100644
--- a/Code/Mantid/Framework/Crystal/src/FilterPeaks.cpp
+++ b/Code/Mantid/Framework/Crystal/src/FilterPeaks.cpp
@@ -40,9 +40,9 @@ FilterPeaks::FilterPeaks() {}
 FilterPeaks::~FilterPeaks() {}
 
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string FilterPeaks::name() const { return "FilterPeaks"; };
+const std::string FilterPeaks::name() const { return "FilterPeaks"; }
 /// Algorithm's version for identification. @see Algorithm::version
-int FilterPeaks::version() const { return 1; };
+int FilterPeaks::version() const { return 1; }
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string FilterPeaks::category() const { return "Crystal"; }
 
diff --git a/Code/Mantid/Framework/Crystal/src/FindClusterFaces.cpp b/Code/Mantid/Framework/Crystal/src/FindClusterFaces.cpp
index fe9266df134f40195b04b710e4769a0f23ba5705..2332de05184709d69f6492a0b20ea0a374c851ab 100644
--- a/Code/Mantid/Framework/Crystal/src/FindClusterFaces.cpp
+++ b/Code/Mantid/Framework/Crystal/src/FindClusterFaces.cpp
@@ -270,10 +270,10 @@ FindClusterFaces::~FindClusterFaces() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string FindClusterFaces::name() const { return "FindClusterFaces"; };
+const std::string FindClusterFaces::name() const { return "FindClusterFaces"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int FindClusterFaces::version() const { return 1; };
+int FindClusterFaces::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string FindClusterFaces::category() const { return "Crystal"; }
diff --git a/Code/Mantid/Framework/Crystal/src/HasUB.cpp b/Code/Mantid/Framework/Crystal/src/HasUB.cpp
index fcc9477ff9ff3357cc5ef6182249279a1491153f..2bf028caa4c0f39b6b4b302ccda2c69a2bf0fcb0 100644
--- a/Code/Mantid/Framework/Crystal/src/HasUB.cpp
+++ b/Code/Mantid/Framework/Crystal/src/HasUB.cpp
@@ -21,10 +21,10 @@ HasUB::~HasUB() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string HasUB::name() const { return "HasUB"; };
+const std::string HasUB::name() const { return "HasUB"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int HasUB::version() const { return 1; };
+int HasUB::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string HasUB::category() const { return "Crystal"; }
diff --git a/Code/Mantid/Framework/Crystal/src/IntegratePeaksHybrid.cpp b/Code/Mantid/Framework/Crystal/src/IntegratePeaksHybrid.cpp
index 83c00772d38cabaa8fb32c690d49513dbb3d5737..c7d2f6fd8ede9ea1f60c8ae3d529eca139d2900c 100644
--- a/Code/Mantid/Framework/Crystal/src/IntegratePeaksHybrid.cpp
+++ b/Code/Mantid/Framework/Crystal/src/IntegratePeaksHybrid.cpp
@@ -101,10 +101,10 @@ IntegratePeaksHybrid::~IntegratePeaksHybrid() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string IntegratePeaksHybrid::name() const {
   return "IntegratePeaksHybrid";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int IntegratePeaksHybrid::version() const { return 1; };
+int IntegratePeaksHybrid::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string IntegratePeaksHybrid::category() const {
diff --git a/Code/Mantid/Framework/Crystal/src/IntegratePeaksUsingClusters.cpp b/Code/Mantid/Framework/Crystal/src/IntegratePeaksUsingClusters.cpp
index 84843b0b2b34c15bec5ba2044904bf0b2a2152db..5b6aeeb76773b008fd7acaa5f907d5de6b150c52 100644
--- a/Code/Mantid/Framework/Crystal/src/IntegratePeaksUsingClusters.cpp
+++ b/Code/Mantid/Framework/Crystal/src/IntegratePeaksUsingClusters.cpp
@@ -48,10 +48,10 @@ IntegratePeaksUsingClusters::~IntegratePeaksUsingClusters() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string IntegratePeaksUsingClusters::name() const {
   return "IntegratePeaksUsingClusters";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int IntegratePeaksUsingClusters::version() const { return 1; };
+int IntegratePeaksUsingClusters::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string IntegratePeaksUsingClusters::category() const {
diff --git a/Code/Mantid/Framework/Crystal/src/LoadIsawPeaks.cpp b/Code/Mantid/Framework/Crystal/src/LoadIsawPeaks.cpp
index 1e4e7a331a111c8efd0688c074c6b2c543565d5d..9612ce7b2638fb1c36be68acb38c8000fc5d96f6 100644
--- a/Code/Mantid/Framework/Crystal/src/LoadIsawPeaks.cpp
+++ b/Code/Mantid/Framework/Crystal/src/LoadIsawPeaks.cpp
@@ -28,7 +28,7 @@ using Mantid::Kernel::Units::Wavelength;
 namespace Mantid {
 namespace Crystal {
 
-DECLARE_FILELOADER_ALGORITHM(LoadIsawPeaks);
+DECLARE_FILELOADER_ALGORITHM(LoadIsawPeaks)
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
diff --git a/Code/Mantid/Framework/Crystal/src/PeakIntensityVsRadius.cpp b/Code/Mantid/Framework/Crystal/src/PeakIntensityVsRadius.cpp
index 53ccf36f9059ddcbbe5f714b6f87e9199cfc01ab..e1381d541dabb89a468fb74552c1018693e9adac 100644
--- a/Code/Mantid/Framework/Crystal/src/PeakIntensityVsRadius.cpp
+++ b/Code/Mantid/Framework/Crystal/src/PeakIntensityVsRadius.cpp
@@ -29,10 +29,10 @@ PeakIntensityVsRadius::~PeakIntensityVsRadius() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string PeakIntensityVsRadius::name() const {
   return "PeakIntensityVsRadius";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int PeakIntensityVsRadius::version() const { return 1; };
+int PeakIntensityVsRadius::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string PeakIntensityVsRadius::category() const { return "Crystal"; }
diff --git a/Code/Mantid/Framework/Crystal/src/PeaksInRegion.cpp b/Code/Mantid/Framework/Crystal/src/PeaksInRegion.cpp
index b8b112cb7a46bb892bb362620f8b32ec93f8fc5f..dc590f5b4c62941b8d5fe6b2ced7bd86515ad3dd 100644
--- a/Code/Mantid/Framework/Crystal/src/PeaksInRegion.cpp
+++ b/Code/Mantid/Framework/Crystal/src/PeaksInRegion.cpp
@@ -26,10 +26,10 @@ PeaksInRegion::~PeaksInRegion() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string PeaksInRegion::name() const { return "PeaksInRegion"; };
+const std::string PeaksInRegion::name() const { return "PeaksInRegion"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int PeaksInRegion::version() const { return 1; };
+int PeaksInRegion::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string PeaksInRegion::category() const { return "Crystal"; }
diff --git a/Code/Mantid/Framework/Crystal/src/PeaksOnSurface.cpp b/Code/Mantid/Framework/Crystal/src/PeaksOnSurface.cpp
index f0dded52a8424d6417810af3c1126d062c266761..3bd6da8e03fd5d7b4815a3fc17d4a80730719d0c 100644
--- a/Code/Mantid/Framework/Crystal/src/PeaksOnSurface.cpp
+++ b/Code/Mantid/Framework/Crystal/src/PeaksOnSurface.cpp
@@ -25,10 +25,10 @@ PeaksOnSurface::~PeaksOnSurface() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string PeaksOnSurface::name() const { return "PeaksOnSurface"; };
+const std::string PeaksOnSurface::name() const { return "PeaksOnSurface"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int PeaksOnSurface::version() const { return 1; };
+int PeaksOnSurface::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string PeaksOnSurface::category() const { return "Crystal"; }
diff --git a/Code/Mantid/Framework/Crystal/src/SCDCalibratePanels.cpp b/Code/Mantid/Framework/Crystal/src/SCDCalibratePanels.cpp
index 79f0d3da50ea775480d39fcb55ba4ba911e09927..106ed965dab2d10f23f8e4be54ceb8bc845d3837 100644
--- a/Code/Mantid/Framework/Crystal/src/SCDCalibratePanels.cpp
+++ b/Code/Mantid/Framework/Crystal/src/SCDCalibratePanels.cpp
@@ -1669,7 +1669,7 @@ void SCDCalibratePanels::FixUpBankParameterMap(
 void writeXmlParameter(ofstream &ostream, const string &name,
                        const double value) {
   ostream << "  <parameter name =\"" << name << "\"><value val=\"" << value
-          << "\" />" << endl;
+     << "\" /> </parameter>" << endl;
 }
 
 void
diff --git a/Code/Mantid/Framework/Crystal/src/SetSpecialCoordinates.cpp b/Code/Mantid/Framework/Crystal/src/SetSpecialCoordinates.cpp
index 784d7244d529599c40f3bebd8d40bc8b362762be..61ecc88afb96ba393511d9b0d1dc4b58c8643696 100644
--- a/Code/Mantid/Framework/Crystal/src/SetSpecialCoordinates.cpp
+++ b/Code/Mantid/Framework/Crystal/src/SetSpecialCoordinates.cpp
@@ -56,10 +56,10 @@ SetSpecialCoordinates::~SetSpecialCoordinates() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string SetSpecialCoordinates::name() const {
   return "SetSpecialCoordinates";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int SetSpecialCoordinates::version() const { return 1; };
+int SetSpecialCoordinates::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string SetSpecialCoordinates::category() const { return "Crystal"; }
diff --git a/Code/Mantid/Framework/Crystal/src/SortPeaksWorkspace.cpp b/Code/Mantid/Framework/Crystal/src/SortPeaksWorkspace.cpp
index d9422413e6c5f6fdb0100a31f3f849943ff3abf3..2045ca8d73f848bc1658162d4650c8b51cba1a4e 100644
--- a/Code/Mantid/Framework/Crystal/src/SortPeaksWorkspace.cpp
+++ b/Code/Mantid/Framework/Crystal/src/SortPeaksWorkspace.cpp
@@ -29,10 +29,10 @@ SortPeaksWorkspace::~SortPeaksWorkspace() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string SortPeaksWorkspace::name() const {
   return "SortPeaksWorkspace";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int SortPeaksWorkspace::version() const { return 1; };
+int SortPeaksWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string SortPeaksWorkspace::category() const { return "Crystal"; }
diff --git a/Code/Mantid/Framework/CurveFitting/CMakeLists.txt b/Code/Mantid/Framework/CurveFitting/CMakeLists.txt
index 7b1cd0ed1c9c20f23301695238878afc433d8ad0..987301cf78bcd134fa4d89bb421996bfaa8c2a63 100644
--- a/Code/Mantid/Framework/CurveFitting/CMakeLists.txt
+++ b/Code/Mantid/Framework/CurveFitting/CMakeLists.txt
@@ -68,6 +68,8 @@ set ( SRC_FILES
 	src/NormaliseByPeakArea.cpp
 	src/PRConjugateGradientMinimizer.cpp
 	src/ParDomain.cpp
+	src/PawleyFit.cpp
+	src/PawleyFunction.cpp
 	src/PeakParameterFunction.cpp
 	src/PlotPeakByLogValue.cpp
 	src/Polynomial.cpp
@@ -181,6 +183,8 @@ set ( INC_FILES
 	inc/MantidCurveFitting/NormaliseByPeakArea.h
 	inc/MantidCurveFitting/PRConjugateGradientMinimizer.h
 	inc/MantidCurveFitting/ParDomain.h
+	inc/MantidCurveFitting/PawleyFit.h
+	inc/MantidCurveFitting/PawleyFunction.h
 	inc/MantidCurveFitting/PeakParameterFunction.h
 	inc/MantidCurveFitting/PlotPeakByLogValue.h
 	inc/MantidCurveFitting/Polynomial.h
@@ -260,14 +264,14 @@ set ( TEST_FILES
 	FullprofPolynomialTest.h
 	FunctionDomain1DSpectrumCreatorTest.h
 	FunctionFactoryConstraintTest.h
-        FunctionParameterDecoratorFitTest.h
+	FunctionParameterDecoratorFitTest.h
 	GSLMatrixTest.h
 	GausDecayTest.h
 	GausOscTest.h
 	GaussianComptonProfileTest.h
 	GaussianTest.h
 	GramCharlierComptonProfileTest.h
-        IPeakFunctionCentreParameterNameTest.h
+	IPeakFunctionCentreParameterNameTest.h
 	IPeakFunctionIntensityTest.h
 	IkedaCarpenterPVTest.h
 	LeBailFitTest.h
@@ -285,6 +289,8 @@ set ( TEST_FILES
 	NeutronBk2BkExpConvPVoigtTest.h
 	NormaliseByPeakAreaTest.h
 	PRConjugateGradientTest.h
+	PawleyFitTest.h
+	PawleyFunctionTest.h
 	PeakParameterFunctionTest.h
 	PlotPeakByLogValueTest.h
 	PolynomialTest.h
diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/AugmentedLagrangianOptimizer.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/AugmentedLagrangianOptimizer.h
index ae06a79fe7bf08012a271901077c1302d6634217..8bbc05dd38b50e3d10f48d44c99bba05d12038a2 100644
--- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/AugmentedLagrangianOptimizer.h
+++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/AugmentedLagrangianOptimizer.h
@@ -154,8 +154,8 @@ public:
   void minimize(std::vector<double> &xv) const;
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(AugmentedLagrangianOptimizer);
-  DISABLE_COPY_AND_ASSIGN(AugmentedLagrangianOptimizer);
+  DISABLE_DEFAULT_CONSTRUCT(AugmentedLagrangianOptimizer)
+  DISABLE_COPY_AND_ASSIGN(AugmentedLagrangianOptimizer)
 
   friend class UnconstrainedCostFunction;
   /// Using gradient optimizer to perform limited optimization of current set
diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c00d9b1c35c99de7bb46b96796ea4400fc13f58
--- /dev/null
+++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h
@@ -0,0 +1,83 @@
+#ifndef MANTID_CURVEFITTING_PAWLEYFIT_H_
+#define MANTID_CURVEFITTING_PAWLEYFIT_H_
+
+#include "MantidKernel/System.h"
+#include "MantidAPI/Algorithm.h"
+#include "MantidCurveFitting/PawleyFunction.h"
+#include "MantidKernel/Unit.h"
+
+namespace Mantid {
+namespace CurveFitting {
+
+/** PawleyFit
+
+  This algorithm uses the Pawley-method to refine lattice parameters using a
+  powder diffractogram and a list of unique Miller indices. From the initial
+  lattice parameters, theoretical reflection positions are calculated. Each
+  reflection is described by the peak profile function supplied by the user and
+  all parameters except the one for location of the reflection are freely
+  refined. Available lattice parameters depend on the selected crystal system.
+
+    @author Michael Wedel, Paul Scherrer Institut - SINQ
+    @date 15/03/2015
+
+  Copyright © 2015 PSI-NXMM
+
+  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>
+  Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+class DLLExport PawleyFit : public API::Algorithm {
+public:
+  PawleyFit();
+  virtual ~PawleyFit() {}
+
+  const std::string name() const { return "PawleyFit"; }
+  int version() const { return 1; }
+  const std::string summary() const;
+  const std::string category() const { return "Diffraction"; }
+
+protected:
+  double getTransformedCenter(double d, const Kernel::Unit_sptr &unit) const;
+
+  void addHKLsToFunction(PawleyFunction_sptr &pawleyFn,
+                         const API::ITableWorkspace_sptr &tableWs,
+                         const Kernel::Unit_sptr &unit, double startX,
+                         double endX) const;
+
+  Kernel::V3D getHKLFromColumn(size_t i,
+                               const API::Column_const_sptr &hklColumn) const;
+  Kernel::V3D getHkl(const std::string &hklString) const;
+
+  API::ITableWorkspace_sptr
+  getLatticeFromFunction(const PawleyFunction_sptr &pawleyFn) const;
+  API::ITableWorkspace_sptr
+  getPeakParametersFromFunction(const PawleyFunction_sptr &pawleyFn) const;
+
+  API::IFunction_sptr
+  getCompositeFunction(const PawleyFunction_sptr &pawleyFn) const;
+
+  void init();
+  void exec();
+
+  Kernel::Unit_sptr m_dUnit;
+};
+
+} // namespace CurveFitting
+} // namespace Mantid
+
+#endif /* MANTID_CURVEFITTING_PAWLEYFIT_H_ */
diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb0e9fb7acae149213d0e76acb2d45c81e135a4a
--- /dev/null
+++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h
@@ -0,0 +1,166 @@
+#ifndef MANTID_CURVEFITTING_PAWLEYFUNCTION_H_
+#define MANTID_CURVEFITTING_PAWLEYFUNCTION_H_
+
+#include "MantidKernel/System.h"
+#include "MantidAPI/CompositeFunction.h"
+#include "MantidAPI/FunctionParameterDecorator.h"
+#include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/IPeakFunction.h"
+#include "MantidAPI/ParamFunction.h"
+
+#include "MantidGeometry/Crystal/PointGroup.h"
+#include "MantidGeometry/Crystal/UnitCell.h"
+
+namespace Mantid {
+namespace CurveFitting {
+
+/** @class PawleyParameterFunction
+
+  This function is used internally by PawleyFunction to hold the unit cell
+  parameters as well as the ZeroShift parameter. The function and functionDeriv-
+  methods have been implemented to do nothing, the calculation of the spectrum
+  that results from the unit cell is calculated in PawleyFunction.
+
+  Additionally it stores the crystal system and the name of the profile function
+  that is used to model the Bragg peaks as attributes.
+*/
+class DLLExport PawleyParameterFunction : virtual public API::IFunction,
+                                          virtual public API::ParamFunction {
+public:
+  PawleyParameterFunction();
+  virtual ~PawleyParameterFunction() {}
+
+  /// Returns the function name
+  std::string name() const { return "PawleyParameterFunction"; }
+
+  void setAttribute(const std::string &attName, const Attribute &attValue);
+
+  Geometry::PointGroup::CrystalSystem getCrystalSystem() const;
+  Geometry::UnitCell getUnitCellFromParameters() const;
+  void setParametersFromUnitCell(const Geometry::UnitCell &cell);
+
+  /// Returns the stored profile function name
+  std::string getProfileFunctionName() const {
+    return getAttribute("ProfileFunction").asString();
+  }
+
+  /// Returns the name of the stored function's center parameter
+  std::string getProfileFunctionCenterParameterName() const {
+    return m_profileFunctionCenterParameterName;
+  }
+
+  void function(const API::FunctionDomain &domain,
+                API::FunctionValues &values) const;
+  void functionDeriv(const API::FunctionDomain &domain,
+                     API::Jacobian &jacobian);
+
+protected:
+  void init();
+
+  void setProfileFunction(const std::string &profileFunction);
+  void setCrystalSystem(const std::string &crystalSystem);
+
+  void createCrystalSystemParameters(
+      Geometry::PointGroup::CrystalSystem crystalSystem);
+  void setCenterParameterNameFromFunction(
+      const API::IPeakFunction_sptr &profileFunction);
+
+  Geometry::PointGroup::CrystalSystem m_crystalSystem;
+  std::string m_profileFunctionCenterParameterName;
+};
+
+typedef boost::shared_ptr<PawleyParameterFunction> PawleyParameterFunction_sptr;
+
+/** @class PawleyFunction
+
+  The Pawley approach to obtain lattice parameters from a powder diffractogram
+  works by placing peak profiles at d-values (which result from the lattice
+  parameters and the Miller indices of each peak) and fitting the total profile
+  to the recorded diffractogram.
+
+  Depending on the chosen crystal system, this function exposes the appropriate
+  lattice parameters as parameters, as well as profile parameters of the
+  individual peak functions, except the peak locations, which are a direct
+  result of their HKLs in combination with the unit cell.
+
+    @author Michael Wedel, Paul Scherrer Institut - SINQ
+    @date 11/03/2015
+
+  Copyright © 2015 PSI-NXMM
+
+  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>
+  Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+class DLLExport PawleyFunction : public API::FunctionParameterDecorator {
+public:
+  PawleyFunction();
+  virtual ~PawleyFunction() {}
+
+  /// Returns the name of the function.
+  std::string name() const { return "PawleyFunction"; }
+
+  void
+  setMatrixWorkspace(boost::shared_ptr<const API::MatrixWorkspace> workspace,
+                     size_t wi, double startX, double endX);
+
+  void setCrystalSystem(const std::string &crystalSystem);
+  void setProfileFunction(const std::string &profileFunction);
+  void setUnitCell(const std::string &unitCellString);
+
+  void function(const API::FunctionDomain &domain,
+                API::FunctionValues &values) const;
+
+  /// Derivates are calculated numerically.
+  void functionDeriv(const API::FunctionDomain &domain,
+                     API::Jacobian &jacobian) {
+    calNumericalDeriv(domain, jacobian);
+  }
+
+  void setPeaks(const std::vector<Kernel::V3D> &hkls, double fwhm,
+                double height);
+  void clearPeaks();
+
+  void addPeak(const Kernel::V3D &hkl, double fwhm, double height);
+  size_t getPeakCount() const;
+  API::IPeakFunction_sptr getPeakFunction(size_t i) const;
+  Kernel::V3D getPeakHKL(size_t i) const;
+
+  PawleyParameterFunction_sptr getPawleyParameterFunction() const;
+
+protected:
+  double getTransformedCenter(double d) const;
+
+  void init();
+  void beforeDecoratedFunctionSet(const API::IFunction_sptr &fn);
+
+  API::CompositeFunction_sptr m_compositeFunction;
+  PawleyParameterFunction_sptr m_pawleyParameterFunction;
+  API::CompositeFunction_sptr m_peakProfileComposite;
+
+  std::vector<Kernel::V3D> m_hkls;
+
+  Kernel::Unit_sptr m_dUnit;
+  Kernel::Unit_sptr m_wsUnit;
+};
+
+typedef boost::shared_ptr<PawleyFunction> PawleyFunction_sptr;
+
+} // namespace CurveFitting
+} // namespace Mantid
+
+#endif /* MANTID_CURVEFITTING_PAWLEYFUNCTION_H_ */
diff --git a/Code/Mantid/Framework/CurveFitting/src/CalculateGammaBackground.cpp b/Code/Mantid/Framework/CurveFitting/src/CalculateGammaBackground.cpp
index 6e1ab71224a5be1a6adb77ce010749bf8d57ee8d..d4dfeb2503d74d64dcf47b5655128fc95fc281c3 100644
--- a/Code/Mantid/Framework/CurveFitting/src/CalculateGammaBackground.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/CalculateGammaBackground.cpp
@@ -21,7 +21,7 @@ using namespace Kernel;
 using namespace std;
 
 // Subscription
-DECLARE_ALGORITHM(CalculateGammaBackground);
+DECLARE_ALGORITHM(CalculateGammaBackground)
 
 namespace {
 /// Number of elements in theta direction integration
diff --git a/Code/Mantid/Framework/CurveFitting/src/Chebyshev.cpp b/Code/Mantid/Framework/CurveFitting/src/Chebyshev.cpp
index eb03305943833c56eee0155e06e057bce4d6b1f7..7da4e1d0b8837453722a2f6952a7becc1c442e98 100644
--- a/Code/Mantid/Framework/CurveFitting/src/Chebyshev.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/Chebyshev.cpp
@@ -20,7 +20,7 @@ Chebyshev::Chebyshev() : m_n(0), m_StartX(-1.), m_EndX(1.) {
   declareAttribute("n", Attribute(m_n));
   declareAttribute("StartX", Attribute(m_StartX));
   declareAttribute("EndX", Attribute(m_EndX));
-};
+}
 
 void Chebyshev::function1D(double *out, const double *xValues,
                            const size_t nData) const {
diff --git a/Code/Mantid/Framework/CurveFitting/src/ComptonPeakProfile.cpp b/Code/Mantid/Framework/CurveFitting/src/ComptonPeakProfile.cpp
index 45de68597850991a70f40e2fbf72f1234fe38862..92328afbcff11394c44d05d9cb3a90ac3948e574 100644
--- a/Code/Mantid/Framework/CurveFitting/src/ComptonPeakProfile.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/ComptonPeakProfile.cpp
@@ -8,7 +8,7 @@
 namespace Mantid {
 namespace CurveFitting {
 
-DECLARE_FUNCTION(ComptonPeakProfile);
+DECLARE_FUNCTION(ComptonPeakProfile)
 
 namespace {
 ///@cond
diff --git a/Code/Mantid/Framework/CurveFitting/src/ComptonScatteringCountRate.cpp b/Code/Mantid/Framework/CurveFitting/src/ComptonScatteringCountRate.cpp
index 7bb7dd9b2a5388347a6b074a9dcd6750e5919adf..c0862428093ef84d7da77547440ea1447c9383d8 100644
--- a/Code/Mantid/Framework/CurveFitting/src/ComptonScatteringCountRate.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/ComptonScatteringCountRate.cpp
@@ -20,7 +20,7 @@ const char *BKGD_ORDER_ATTR_NAME = "BackgroundOrderAttr";
 Logger g_log("ComptonScatteringCountRate");
 }
 
-DECLARE_FUNCTION(ComptonScatteringCountRate);
+DECLARE_FUNCTION(ComptonScatteringCountRate)
 
 //----------------------------------------------------------------------------------------------
 /** Constructor
diff --git a/Code/Mantid/Framework/CurveFitting/src/ConvertToYSpace.cpp b/Code/Mantid/Framework/CurveFitting/src/ConvertToYSpace.cpp
index 456d7355884fd03f59ebd77fdf2467a80bab194d..5cb55c3d2aa4d3de894c648b6f82a8ad171b9478 100644
--- a/Code/Mantid/Framework/CurveFitting/src/ConvertToYSpace.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/ConvertToYSpace.cpp
@@ -10,7 +10,7 @@ namespace Mantid {
 namespace CurveFitting {
 
 // Register the algorithm into the AlgorithmFactory
-DECLARE_ALGORITHM(ConvertToYSpace);
+DECLARE_ALGORITHM(ConvertToYSpace)
 
 using namespace API;
 using namespace Kernel;
diff --git a/Code/Mantid/Framework/CurveFitting/src/CubicSpline.cpp b/Code/Mantid/Framework/CurveFitting/src/CubicSpline.cpp
index 893e0f59420f33cff2c973ed4df3971e7b75391f..6b0d2815989e52ae26cf5f7be2a1fe47f8df31e9 100644
--- a/Code/Mantid/Framework/CurveFitting/src/CubicSpline.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/CubicSpline.cpp
@@ -41,7 +41,7 @@ CubicSpline::CubicSpline()
   declareParameter("y0", 0);
   declareParameter("y1", 0);
   declareParameter("y2", 0);
-};
+}
 
 /** Execute the function
  *
diff --git a/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp b/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp
index 1c2042fbdeef39b2a7dc513ac55f977a8987c436..1d7fc6948be06c461bd548383d0c57af5a7f8f1b 100644
--- a/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp
@@ -11,9 +11,9 @@
 namespace Mantid {
 namespace CurveFitting {
 
-DECLARE_FUNCTION(ElasticDiffRotDiscreteCircle);
-DECLARE_FUNCTION(InelasticDiffRotDiscreteCircle);
-DECLARE_FUNCTION(DiffRotDiscreteCircle);
+DECLARE_FUNCTION(ElasticDiffRotDiscreteCircle)
+DECLARE_FUNCTION(InelasticDiffRotDiscreteCircle)
+DECLARE_FUNCTION(DiffRotDiscreteCircle)
 
 ElasticDiffRotDiscreteCircle::ElasticDiffRotDiscreteCircle() {
   // declareParameter("Height", 1.0); //parameter "Height" already declared in
@@ -54,6 +54,7 @@ InelasticDiffRotDiscreteCircle::InelasticDiffRotDiscreteCircle()
   declareParameter("Decay", 1.0, "Inverse of transition rate, in nanoseconds "
                                  "if energy in micro-ev, or picoseconds if "
                                  "energy in mili-eV");
+  declareParameter("Shift", 0.0, "Shift in domain");
 
   declareAttribute("Q", API::IFunction::Attribute(0.5));
   declareAttribute("N", API::IFunction::Attribute(3));
@@ -82,6 +83,7 @@ void InelasticDiffRotDiscreteCircle::function1D(double *out,
   const double rate = m_hbar / getParameter("Decay"); // micro-eV or mili-eV
   const double Q = getAttribute("Q").asDouble();
   const int N = getAttribute("N").asInt();
+  const double S = getParameter("Shift");
 
   std::vector<double> sph(N);
   for (int k = 1; k < N; k++) {
@@ -97,7 +99,7 @@ void InelasticDiffRotDiscreteCircle::function1D(double *out,
   }
 
   for (size_t i = 0; i < nData; i++) {
-    double w = xValues[i];
+    double w = xValues[i] - S;
     double S = 0.0;
     for (int l = 1; l < N; l++) // l goes up to N-1
     {
@@ -166,6 +168,7 @@ void DiffRotDiscreteCircle::init() {
   setAlias("f1.Intensity", "Intensity");
   setAlias("f1.Radius", "Radius");
   setAlias("f1.Decay", "Decay");
+  setAlias("f1.Shift", "Shift");
 
   // Set the ties between Elastic and Inelastic parameters
   addDefaultTies("f0.Height=f1.Intensity,f0.Radius=f1.Radius");
diff --git a/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp b/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp
index aafd90d88c51a38bd2ed7acb867c4e39198a0cdb..28688f243db34ff1ba578372fa6cfc0f6d0e48f2 100644
--- a/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp
@@ -16,9 +16,9 @@ namespace CurveFitting {
 using namespace Kernel;
 using namespace API;
 
-DECLARE_FUNCTION(ElasticDiffSphere);
-DECLARE_FUNCTION(InelasticDiffSphere);
-DECLARE_FUNCTION(DiffSphere);
+DECLARE_FUNCTION(ElasticDiffSphere)
+DECLARE_FUNCTION(InelasticDiffSphere)
+DECLARE_FUNCTION(DiffSphere)
 
 ElasticDiffSphere::ElasticDiffSphere() {
   // declareParameter("Height", 1.0); //parameter "Height" already declared in
@@ -145,6 +145,7 @@ InelasticDiffSphere::InelasticDiffSphere()
   declareParameter("Diffusion", 0.05, "Diffusion coefficient, in units of "
                                       "A^2*THz, if energy in meV, or A^2*PHz "
                                       "if energy in ueV");
+  declareParameter("Shift", 0.0, "Shift in domain");
 
   declareAttribute("Q", API::IFunction::Attribute(1.0));
 }
@@ -194,6 +195,7 @@ void InelasticDiffSphere::function1D(double *out, const double *xValues,
   const double R = getParameter("Radius");
   const double D = getParameter("Diffusion");
   const double Q = getAttribute("Q").asDouble();
+  const double S = getParameter("Shift");
 
   // // Penalize negative parameters
   if (I < std::numeric_limits<double>::epsilon() ||
@@ -216,7 +218,7 @@ void InelasticDiffSphere::function1D(double *out, const double *xValues,
   std::vector<double> YJ;
   YJ = LorentzianCoefficients(Q * R); // The (2l+1)*A_{n,l}
   for (size_t i = 0; i < nData; i++) {
-    double energy = xValues[i]; // from meV to THz (or from micro-eV to PHz)
+    double energy = xValues[i] - S; // from meV to THz (or from micro-eV to PHz)
     out[i] = 0.0;
     for (size_t n = 0; n < ncoeff; n++) {
       double L = (1.0 / M_PI) * HWHM[n] /
@@ -272,6 +274,7 @@ void DiffSphere::init() {
   setAlias("f1.Intensity", "Intensity");
   setAlias("f1.Radius", "Radius");
   setAlias("f1.Diffusion", "Diffusion");
+  setAlias("f1.Shift", "Shift");
 
   // Set the ties between Elastic and Inelastic parameters
   addDefaultTies("f0.Height=f1.Intensity,f0.Radius=f1.Radius");
diff --git a/Code/Mantid/Framework/CurveFitting/src/DynamicKuboToyabe.cpp b/Code/Mantid/Framework/CurveFitting/src/DynamicKuboToyabe.cpp
index 4b7bae69801a1dceab858717f86c4fe29435abbd..d19e1e94fada5d6b90608c50aec635f484fcc093 100644
--- a/Code/Mantid/Framework/CurveFitting/src/DynamicKuboToyabe.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/DynamicKuboToyabe.cpp
@@ -24,6 +24,111 @@ void DynamicKuboToyabe::init()
   declareParameter("Nu",    0.0, "Hopping rate");
 }
 
+
+//--------------------------------------------------------------------------------------------------------------------------------------
+// From Numerical Recipes
+
+// Midpoint method
+double midpnt(double func(const double, const double, const double),
+	const double a, const double b, const int n, const double g, const double w0) {
+// quote & modified from numerical recipe 2nd edtion (page147)	
+	
+  static double s;
+
+	if (n==1) {
+    s = (b-a)*func(0.5*(a+b),g,w0);
+    return (s);
+	} else {
+		double x, tnm, sum, del, ddel;
+		int it, j;
+		for (it=1,j=1;j<n-1;j++) it *= 3;
+		tnm = it;
+		del = (b-a)/(3*tnm);
+		ddel=del+del;
+		x = a+0.5*del;
+		sum =0.0;
+		for (j=1;j<=it;j++) {
+			sum += func(x,g,w0);
+			x += ddel;
+			sum += func(x,g,w0);
+			x += del;
+		}
+		s=(s+(b-a)*sum/tnm)/3.0;
+		return s;
+	}
+}
+
+// Polynomial interpolation
+void polint (double xa[], double ya[], int n, double x, double& y, double& dy) {
+	int i, m, ns = 1;
+  double dif;
+
+  dif = fabs(x-xa[1]);
+  std::vector<double> c(n+1);
+  std::vector<double> d(n+1);
+	for (i=1;i<=n;i++){
+    double dift;
+		if((dift=fabs(x-xa[i]))<dif) {
+			ns=i;
+			dif=dift;
+		}
+    c[i]=ya[i];
+		d[i]=ya[i];
+	}
+	y=ya[ns--];
+	for (m=1;m<n;m++) {
+		for (i=1;i<=n-m;i++) {
+      double den, ho, hp, w;
+			ho=xa[i]-x;
+			hp=xa[i+m]-x;
+			w=c[i+1]-d[i];
+			if((den=ho-hp)==0.0){ //error message!!!
+        throw std::runtime_error("Error in routin polint");
+      }
+			den=w/den;
+			d[i]=hp*den;
+			c[i]=ho*den;
+		}
+		y += (dy=(2*(ns)<(n-m) ? c[ns+1] : d[ns--]));
+
+	}
+
+}
+
+// Integration
+double integral (double func(const double, const double, const double),
+                 const double a, const double b, const double g, const double w0) {
+
+  const int JMAX = 14;
+  const int JMAXP = JMAX + 1;
+  const int K = 5;
+
+  int j;
+  double ss,dss;
+	double h[JMAXP+1], s[JMAXP];
+
+	h[1] = 1.0;
+	for (j=1; j<= JMAX; j++) {
+		s[j]=midpnt(func,a,b,j,g,w0);
+		if (j >= K) {
+			polint(&h[j-K],&s[j-K],K,0.0,ss,dss);
+			if (fabs(dss) <= fabs(ss)) return ss;
+		}
+		h[j+1]=h[j]/9.0;
+	}
+  throw std::runtime_error("Too many steps in routine integrate");
+	return 0.0;
+}
+
+// End of Numerical Recipes routines
+//--------------------------------------------------------------------------------------------------------------------------------------
+
+
+// f1: function to integrate
+double f1(const double x, const double G, const double w0) {
+  return( exp(-G*G*x*x/2)*sin(w0*x));
+}
+
 // Static Zero Field Kubo Toyabe relaxation function
 double ZFKT (const double x, const double G){
 
@@ -31,33 +136,78 @@ double ZFKT (const double x, const double G){
   return (0.3333333333 + 0.6666666667*exp(-0.5*q)*(1-q));
 }
 
+// Static non-zero field Kubo Toyabe relaxation function
+double HKT (const double x, const double G, const double F) {
+
+  const double q = G*G*x*x;
+  const double gm = 2*M_PI*0.01355342; // Muon gyromagnetic ratio * 2 * PI
+  
+  double w;
+  if (F>2*G) {
+    // Use F
+    w = gm * F;
+  } else {
+    // Use G
+    w = gm * 2 * G;
+  }
+  
+  const double r = G*G/w/w;
+  
+  double ig;
+  if ( x>0 && r>0 ) {
+    // Compute integral
+    ig = integral(f1,0.0,x,G,w);
+  } else {
+    // Integral is 0
+    ig = 0;
+  }
+  
+  const double ktb=(1-2*r*(1-exp(-q/2)*cos(w*x))+2*r*r*w*ig);
+  
+  if ( F>2*G ) {
+    return ktb;
+  } else {
+    const double kz = ZFKT(x,G);
+    return kz+F/2/G*(ktb-kz);
+  }
+  
+}
+
 // Dynamic Kubo-Toyabe
-double getDKT (double t, double G, double v){
+double getDKT (double t, double G, double F, double v){
 
   const int tsmax = 656; // Length of the time axis, 32 us of valid data
   const double eps = 0.05; // Bin width for calculations
 
-  static double oldG=-1., oldV=-1.;
+  static double oldG=-1., oldV=-1., oldF=-1.;
   static std::vector<double> gStat(tsmax), gDyn(tsmax);
 
 
-  if ( (G != oldG) || (v != oldV) ){
+  if ( (G != oldG) || (v != oldV) || (F != oldF) ){
 
-    // If G or v have changed with respect to the 
+    // If G or v or F have changed with respect to the 
     // previous call, we need to re-do the computations
 
 
-    if ( G != oldG ){
+    if ( G != oldG || (F != oldF) ){
 
       // But we only need to
-      // re-compute gStat if G has changed
+      // re-compute gStat if G or F have changed
 
       // Generate static Kubo-Toyabe
-      for (int k=0; k<tsmax; k++){
-        gStat[k]= ZFKT(k*eps,G);
+      if (F == 0) {
+        for (int k=0; k<tsmax; k++){
+          gStat[k]= ZFKT(k*eps,G);
+        }
+      } else {
+        for (int k=0; k<tsmax; k++){
+          gStat[k]= HKT(k*eps,G,F);
+        }
       }
       // Store new G value
       oldG =G;
+      // Store new F value
+      oldF =F;
     }
 
     // Store new v value
@@ -105,26 +255,19 @@ void DynamicKuboToyabe::function1D(double* out, const double* xValues, const siz
     }
     // Non-zero external field
     else{
-      throw std::runtime_error("HKT() not implemented yet");
+      for (size_t i = 0; i < nData; i++) {
+        out[i] = A*HKT(xValues[i],G,F);
+      }
     }
   } 
 
   // Non-zero hopping rate
   else {
 
-    if ( F==0.0 ) {
-
-      for (size_t i = 0; i<nData; i++){
-        out[i] = A*getDKT(xValues[i],G,v);
-      }
-
-    } else {
-
-      // Non-zero field
-      throw std::runtime_error("HKT() not implemented yet");
+    for (size_t i = 0; i<nData; i++){
+      out[i] = A*getDKT(xValues[i],G,F,v);
     }
-
-  } // else hopping rate != 0
+  }
 
 
 }
diff --git a/Code/Mantid/Framework/CurveFitting/src/EstimatePeakErrors.cpp b/Code/Mantid/Framework/CurveFitting/src/EstimatePeakErrors.cpp
index b2d70ca84b52ce3c13fe7dd625ac698e10df1997..a57f7e2cfd200cfcff18dfa2c7394723d8e7077d 100644
--- a/Code/Mantid/Framework/CurveFitting/src/EstimatePeakErrors.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/EstimatePeakErrors.cpp
@@ -17,7 +17,7 @@ using namespace Kernel;
 using namespace std;
 
 // Subscription
-DECLARE_ALGORITHM(EstimatePeakErrors);
+DECLARE_ALGORITHM(EstimatePeakErrors)
 
 //--------------------------------------------------------------------------------------------------------
 // Public members
diff --git a/Code/Mantid/Framework/CurveFitting/src/GaussianComptonProfile.cpp b/Code/Mantid/Framework/CurveFitting/src/GaussianComptonProfile.cpp
index f1600c26fc8a0ddcb49939f64d5fc114381b5dfe..b77daafba109cacdcaa99a37c0f10d5291b8227a 100644
--- a/Code/Mantid/Framework/CurveFitting/src/GaussianComptonProfile.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/GaussianComptonProfile.cpp
@@ -6,7 +6,7 @@
 
 namespace Mantid {
 namespace CurveFitting {
-DECLARE_FUNCTION(GaussianComptonProfile);
+DECLARE_FUNCTION(GaussianComptonProfile)
 
 const char *WIDTH_PARAM = "Width";
 const char *AMP_PARAM = "Intensity";
diff --git a/Code/Mantid/Framework/CurveFitting/src/GramCharlierComptonProfile.cpp b/Code/Mantid/Framework/CurveFitting/src/GramCharlierComptonProfile.cpp
index c6a64b0fbb44308a177a2ad9d56b795ed331a548..fe20a841b14106e5149e0f1609f16423d7ede2ea 100644
--- a/Code/Mantid/Framework/CurveFitting/src/GramCharlierComptonProfile.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/GramCharlierComptonProfile.cpp
@@ -14,7 +14,7 @@
 namespace Mantid {
 namespace CurveFitting {
 // Register into factory
-DECLARE_FUNCTION(GramCharlierComptonProfile);
+DECLARE_FUNCTION(GramCharlierComptonProfile)
 
 namespace {
 ///@cond
diff --git a/Code/Mantid/Framework/CurveFitting/src/IkedaCarpenterPV.cpp b/Code/Mantid/Framework/CurveFitting/src/IkedaCarpenterPV.cpp
index e9d8a908511a5e0e01bf15bfe306c4955440bcc2..527a9c39698081e58d8acc3d322ee20b35585697 100644
--- a/Code/Mantid/Framework/CurveFitting/src/IkedaCarpenterPV.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/IkedaCarpenterPV.cpp
@@ -49,7 +49,7 @@ void IkedaCarpenterPV::setHeight(const double h) {
 
   // The intensity is then estimated to be h/h0
   setParameter("I", h / h0);
-};
+}
 
 double IkedaCarpenterPV::height() const {
   // return the function value at centre()
@@ -59,7 +59,7 @@ double IkedaCarpenterPV::height() const {
   toCentre[0] = centre();
   constFunction(h0, toCentre, 1);
   return h0[0];
-};
+}
 
 double IkedaCarpenterPV::fwhm() const {
   double sigmaSquared = getParameter("SigmaSquared");
@@ -83,14 +83,14 @@ double IkedaCarpenterPV::fwhm() const {
     ;
   }
   return sqrt(8.0 * M_LN2 * sigmaSquared) + gamma;
-};
+}
 
 void IkedaCarpenterPV::setFwhm(const double w) {
   setParameter("SigmaSquared", w * w / (32.0 * M_LN2)); // used 4.0 * 8.0 = 32.0
   setParameter("Gamma", w / 2.0);
-};
+}
 
-void IkedaCarpenterPV::setCentre(const double c) { setParameter("X0", c); };
+void IkedaCarpenterPV::setCentre(const double c) { setParameter("X0", c); }
 
 void IkedaCarpenterPV::init() {
   declareParameter("I", 0.0, "The integrated intensity of the peak. I.e. "
diff --git a/Code/Mantid/Framework/CurveFitting/src/Lorentzian.cpp b/Code/Mantid/Framework/CurveFitting/src/Lorentzian.cpp
index 7791d92f6eabe6156ca93ac74b904da707e68de3..8d58c9a3915b9d7bd87d8d9da9be2a6f5ae70be0 100644
--- a/Code/Mantid/Framework/CurveFitting/src/Lorentzian.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/Lorentzian.cpp
@@ -11,7 +11,7 @@ namespace CurveFitting {
 using namespace Kernel;
 using namespace API;
 
-DECLARE_FUNCTION(Lorentzian);
+DECLARE_FUNCTION(Lorentzian)
 
 void Lorentzian::init() {
   declareParameter("Amplitude", 1.0, "Intensity scaling");
diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..11a110f20013093857770a0b029f87931656e4a0
--- /dev/null
+++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp
@@ -0,0 +1,405 @@
+#include "MantidCurveFitting/PawleyFit.h"
+
+#include "MantidAPI/FunctionFactory.h"
+#include "MantidCurveFitting/PawleyFunction.h"
+#include "MantidAPI/TableRow.h"
+
+#include "MantidGeometry/Crystal/UnitCell.h"
+#include "MantidKernel/ListValidator.h"
+#include "MantidKernel/UnitFactory.h"
+#include "MantidKernel/UnitConversion.h"
+
+#include <algorithm>
+
+namespace Mantid {
+namespace CurveFitting {
+
+using namespace API;
+using namespace Kernel;
+using namespace Geometry;
+
+DECLARE_ALGORITHM(PawleyFit)
+
+/// Default constructor
+PawleyFit::PawleyFit() : Algorithm(), m_dUnit() {}
+
+/// Returns the summary
+const std::string PawleyFit::summary() const {
+  return "This algorithm performs a Pawley-fit on the supplied workspace.";
+}
+
+/// Transforms the specified value from d-spacing to the supplied unit.
+double PawleyFit::getTransformedCenter(double d, const Unit_sptr &unit) const {
+  if (boost::dynamic_pointer_cast<Units::Empty>(unit) ||
+      boost::dynamic_pointer_cast<Units::dSpacing>(unit)) {
+    return d;
+  }
+
+  return UnitConversion::run(*m_dUnit, *unit, d, 0, 0, 0, DeltaEMode::Elastic,
+                             0);
+}
+
+/**
+ * Add HKLs from a TableWorkspace to the PawleyFunction.
+ *
+ * This method tries to extract reflections from the specified TableWorkspace.
+ * For the extraction to work properly it needs to have columns with the
+ * following labels:
+ *  HKL, d, Intensity, FWHM (rel.)
+ *
+ * The latter three must be convertible to double, otherwise the there will be
+ * no peaks in the function. The value of d is converted to the unit of the
+ * workspace to obtain an absolute FWHM-value, since FWHM (rel.) is defined
+ * as FWHM / center.
+ *
+ * The HKLs can either be a column of V3D or a string column that contains 3
+ * numbers separated by space, comma, semi-colon, or [ ]
+ *
+ * @param pawleyFn :: PawleyFunction which the HKLs should be added to.
+ * @param tableWs :: TableWorkspace that contains the reflection information.
+ * @param unit :: Unit of the workspace.
+ * @param startX :: Lowest allowed x-value for reflection position.
+ * @param endX :: Highest allowed x-value for reflection position.
+ */
+void PawleyFit::addHKLsToFunction(PawleyFunction_sptr &pawleyFn,
+                                  const ITableWorkspace_sptr &tableWs,
+                                  const Unit_sptr &unit, double startX,
+                                  double endX) const {
+  if (!tableWs || !pawleyFn) {
+    throw std::invalid_argument("Can only process non-null function & table.");
+  }
+
+  pawleyFn->clearPeaks();
+
+  try {
+    Column_const_sptr hklColumn = tableWs->getColumn("HKL");
+    Column_const_sptr dColumn = tableWs->getColumn("d");
+    Column_const_sptr intensityColumn = tableWs->getColumn("Intensity");
+    Column_const_sptr fwhmColumn = tableWs->getColumn("FWHM (rel.)");
+
+    for (size_t i = 0; i < tableWs->rowCount(); ++i) {
+      try {
+        V3D hkl = getHKLFromColumn(i, hklColumn);
+
+        double d = (*dColumn)[i];
+        double center = getTransformedCenter(d, unit);
+        double fwhm = (*fwhmColumn)[i] * center;
+        double height = (*intensityColumn)[i];
+
+        if (center > startX && center < endX) {
+          pawleyFn->addPeak(hkl, fwhm, height);
+        }
+      }
+      catch (std::bad_alloc) {
+        // do nothing.
+      }
+    }
+  }
+  catch (std::runtime_error) {
+    // Column does not exist
+    throw std::runtime_error("Can not process table, the following columns are "
+                             "required: HKL, d, Intensity, FWHM (rel.)");
+  }
+}
+
+/// Tries to extract Miller indices as V3D from column.
+V3D PawleyFit::getHKLFromColumn(size_t i,
+                                const Column_const_sptr &hklColumn) const {
+  if (hklColumn->type() == "V3D") {
+    return hklColumn->cell<V3D>(i);
+  }
+
+  return getHkl(hklColumn->cell<std::string>(i));
+}
+
+/// Try to extract a V3D from the given string with different separators.
+V3D PawleyFit::getHkl(const std::string &hklString) const {
+  auto delimiters = boost::is_any_of(" ,[];");
+
+  std::string workingCopy = boost::trim_copy_if(hklString, delimiters);
+  std::vector<std::string> indicesStr;
+  boost::split(indicesStr, workingCopy, delimiters);
+
+  if (indicesStr.size() != 3) {
+    throw std::invalid_argument("Input string cannot be parsed as HKL.");
+  }
+
+  V3D hkl;
+  hkl.setX(boost::lexical_cast<double>(indicesStr[0]));
+  hkl.setY(boost::lexical_cast<double>(indicesStr[1]));
+  hkl.setZ(boost::lexical_cast<double>(indicesStr[2]));
+
+  return hkl;
+}
+
+/// Creates a table containing the cell parameters stored in the supplied
+/// function.
+ITableWorkspace_sptr
+PawleyFit::getLatticeFromFunction(const PawleyFunction_sptr &pawleyFn) const {
+  if (!pawleyFn) {
+    throw std::invalid_argument(
+        "Cannot extract lattice parameters from null function.");
+  }
+
+  ITableWorkspace_sptr latticeParameterTable =
+      WorkspaceFactory::Instance().createTable();
+
+  latticeParameterTable->addColumn("str", "Parameter");
+  latticeParameterTable->addColumn("double", "Value");
+  latticeParameterTable->addColumn("double", "Error");
+
+  PawleyParameterFunction_sptr parameters =
+      pawleyFn->getPawleyParameterFunction();
+
+  for (size_t i = 0; i < parameters->nParams(); ++i) {
+    TableRow newRow = latticeParameterTable->appendRow();
+    newRow << parameters->parameterName(i) << parameters->getParameter(i)
+           << parameters->getError(i);
+  }
+
+  return latticeParameterTable;
+}
+
+/// Extracts all profile parameters from the supplied function.
+ITableWorkspace_sptr PawleyFit::getPeakParametersFromFunction(
+    const PawleyFunction_sptr &pawleyFn) const {
+  if (!pawleyFn) {
+    throw std::invalid_argument(
+        "Cannot extract peak parameters from null function.");
+  }
+
+  ITableWorkspace_sptr peakParameterTable =
+      WorkspaceFactory::Instance().createTable();
+
+  peakParameterTable->addColumn("int", "Peak");
+  peakParameterTable->addColumn("V3D", "HKL");
+  peakParameterTable->addColumn("str", "Parameter");
+  peakParameterTable->addColumn("double", "Value");
+  peakParameterTable->addColumn("double", "Error");
+
+  for (size_t i = 0; i < pawleyFn->getPeakCount(); ++i) {
+
+    IPeakFunction_sptr currentPeak = pawleyFn->getPeakFunction(i);
+
+    int peakNumber = static_cast<int>(i + 1);
+    V3D peakHKL = pawleyFn->getPeakHKL(i);
+
+    for (size_t j = 0; j < currentPeak->nParams(); ++j) {
+      TableRow newRow = peakParameterTable->appendRow();
+      newRow << peakNumber << peakHKL << currentPeak->parameterName(j)
+             << currentPeak->getParameter(j) << currentPeak->getError(j);
+    }
+  }
+
+  return peakParameterTable;
+}
+
+/// Returns a composite function consisting of the Pawley function and Chebyshev
+/// background if enabled in the algorithm.
+IFunction_sptr
+PawleyFit::getCompositeFunction(const PawleyFunction_sptr &pawleyFn) const {
+  CompositeFunction_sptr composite = boost::make_shared<CompositeFunction>();
+  composite->addFunction(pawleyFn);
+
+  bool enableChebyshev = getProperty("EnableChebyshevBackground");
+  if (enableChebyshev) {
+    int degree = getProperty("ChebyshevBackgroundDegree");
+    IFunction_sptr chebyshev =
+        FunctionFactory::Instance().createFunction("Chebyshev");
+    chebyshev->setAttributeValue("n", degree);
+
+    composite->addFunction(chebyshev);
+  }
+
+  return composite;
+}
+
+/// Initialization of properties.
+void PawleyFit::init() {
+  declareProperty(new WorkspaceProperty<MatrixWorkspace>("InputWorkspace", "",
+                                                         Direction::Input),
+                  "Input workspace that contains the spectrum on which to "
+                  "perform the Pawley fit.");
+
+  declareProperty("WorkspaceIndex", 0,
+                  "Spectrum on which the fit should be performed.");
+
+  declareProperty("StartX", 0.0, "Lower border of fitted data range.");
+  declareProperty("EndX", 0.0, "Upper border of fitted data range.");
+
+  std::vector<std::string> crystalSystems;
+  crystalSystems.push_back("Cubic");
+  crystalSystems.push_back("Tetragonal");
+  crystalSystems.push_back("Hexagonal");
+  crystalSystems.push_back("Trigonal");
+  crystalSystems.push_back("Orthorhombic");
+  crystalSystems.push_back("Monoclinic");
+  crystalSystems.push_back("Triclinic");
+
+  auto crystalSystemValidator =
+      boost::make_shared<StringListValidator>(crystalSystems);
+
+  declareProperty("CrystalSystem", crystalSystems.back(),
+                  crystalSystemValidator,
+                  "Crystal system to use for refinement.");
+
+  declareProperty("InitialCell", "1.0 1.0 1.0 90.0 90.0 90.0",
+                  "Specification of initial unit cell, given as 'a, b, c, "
+                  "alpha, beta, gamma'.");
+
+  declareProperty(
+      new WorkspaceProperty<ITableWorkspace>("PeakTable", "", Direction::Input),
+      "Table with peak information. Can be used instead of "
+      "supplying a list of indices for better starting parameters.");
+
+  declareProperty("RefineZeroShift", false, "If checked, a zero-shift with the "
+                                            "same unit as the spectrum is "
+                                            "refined.");
+
+  auto peakFunctionValidator = boost::make_shared<StringListValidator>(
+      FunctionFactory::Instance().getFunctionNames<IPeakFunction>());
+
+  declareProperty("PeakProfileFunction", "Gaussian", peakFunctionValidator,
+                  "Profile function that is used for each peak.");
+
+  declareProperty("EnableChebyshevBackground", false,
+                  "If checked, a Chebyshev "
+                  "polynomial will be added "
+                  "to model the background.");
+
+  declareProperty("ChebyshevBackgroundDegree", 0,
+                  "Degree of the Chebyshev polynomial, if used as background.");
+
+  declareProperty("CalculationOnly", false, "If enabled, no fit is performed, "
+                                            "the function is only evaluated "
+                                            "and output is generated.");
+
+  declareProperty(new WorkspaceProperty<MatrixWorkspace>("OutputWorkspace", "",
+                                                         Direction::Output),
+                  "Workspace that contains measured spectrum, calculated "
+                  "spectrum and difference curve.");
+
+  declareProperty(
+      new WorkspaceProperty<ITableWorkspace>("RefinedCellTable", "",
+                                             Direction::Output),
+      "TableWorkspace with refined lattice parameters, including errors.");
+
+  declareProperty(
+      new WorkspaceProperty<ITableWorkspace>("RefinedPeakParameterTable", "",
+                                             Direction::Output),
+      "TableWorkspace with refined peak parameters, including errors.");
+
+  declareProperty("ReducedChiSquare", 0.0, "Outputs the reduced chi square "
+                                           "value as a measure for the quality "
+                                           "of the fit.",
+                  Direction::Output);
+
+  m_dUnit = UnitFactory::Instance().create("dSpacing");
+}
+
+/// Execution of algorithm.
+void PawleyFit::exec() {
+  // Setup PawleyFunction with cell from input parameters
+  PawleyFunction_sptr pawleyFn = boost::dynamic_pointer_cast<PawleyFunction>(
+      FunctionFactory::Instance().createFunction("PawleyFunction"));
+  g_log.information() << "Setting up Pawley function..." << std::endl;
+
+  std::string profileFunction = getProperty("PeakProfileFunction");
+  pawleyFn->setProfileFunction(profileFunction);
+  g_log.information() << "  Selected profile function: " << profileFunction
+                      << std::endl;
+
+  std::string crystalSystem = getProperty("CrystalSystem");
+  pawleyFn->setCrystalSystem(crystalSystem);
+  g_log.information() << "  Selected crystal system: " << crystalSystem
+                      << std::endl;
+
+  pawleyFn->setUnitCell(getProperty("InitialCell"));
+  PawleyParameterFunction_sptr pawleyParameterFunction =
+      pawleyFn->getPawleyParameterFunction();
+  g_log.information()
+      << "  Initial unit cell: "
+      << unitCellToStr(pawleyParameterFunction->getUnitCellFromParameters())
+      << std::endl;
+
+  // Get the input workspace with the data
+  MatrixWorkspace_const_sptr ws = getProperty("InputWorkspace");
+  int wsIndex = getProperty("WorkspaceIndex");
+
+  // Get x-range start and end values, depending on user input
+  const MantidVec &xData = ws->readX(static_cast<size_t>(wsIndex));
+  double startX = xData.front();
+  double endX = xData.back();
+
+  Property *startXProperty = getPointerToProperty("StartX");
+  if (!startXProperty->isDefault()) {
+    double startXInput = getProperty("StartX");
+    startX = std::max(startX, startXInput);
+  }
+
+  Property *endXProperty = getPointerToProperty("EndX");
+  if (!endXProperty->isDefault()) {
+    double endXInput = getProperty("EndX");
+    endX = std::min(endX, endXInput);
+  }
+
+  g_log.information() << "  Refined range: " << startX << " - " << endX
+                      << std::endl;
+
+  // Get HKLs from TableWorkspace
+  ITableWorkspace_sptr peakTable = getProperty("PeakTable");
+  Axis *xAxis = ws->getAxis(0);
+  Unit_sptr xUnit = xAxis->unit();
+  addHKLsToFunction(pawleyFn, peakTable, xUnit, startX, endX);
+
+  g_log.information() << "  Peaks in PawleyFunction: "
+                      << pawleyFn->getPeakCount() << std::endl;
+
+  // Determine if zero-shift should be refined
+  bool refineZeroShift = getProperty("RefineZeroShift");
+  if (!refineZeroShift) {
+    pawleyFn->fix(pawleyFn->parameterIndex("f0.ZeroShift"));
+  } else {
+    g_log.information() << "  Refining ZeroShift." << std::endl;
+  }
+
+  pawleyFn->setMatrixWorkspace(ws, static_cast<size_t>(wsIndex), startX, endX);
+
+  g_log.information() << "Setting up Fit..." << std::endl;
+
+  // Generate Fit-algorithm with required properties.
+  Algorithm_sptr fit = createChildAlgorithm("Fit", -1, -1, true);
+  fit->setProperty("Function", getCompositeFunction(pawleyFn));
+  fit->setProperty("InputWorkspace",
+                   boost::const_pointer_cast<MatrixWorkspace>(ws));
+  fit->setProperty("StartX", startX);
+  fit->setProperty("EndX", endX);
+  fit->setProperty("WorkspaceIndex", wsIndex);
+
+  bool calculationOnly = getProperty("CalculationOnly");
+  if (calculationOnly) {
+    fit->setProperty("MaxIterations", 0);
+  }
+
+  fit->setProperty("CreateOutput", true);
+
+  fit->execute();
+  double chiSquare = fit->getProperty("OutputChi2overDoF");
+
+  g_log.information() << "Fit finished, reduced ChiSquare = " << chiSquare
+                      << std::endl;
+
+  g_log.information() << "Generating output..." << std::endl;
+
+  // Create output
+  MatrixWorkspace_sptr output = fit->getProperty("OutputWorkspace");
+  setProperty("OutputWorkspace", output);
+  setProperty("RefinedCellTable", getLatticeFromFunction(pawleyFn));
+  setProperty("RefinedPeakParameterTable",
+              getPeakParametersFromFunction(pawleyFn));
+
+  setProperty("ReducedChiSquare", chiSquare);
+}
+
+} // namespace CurveFitting
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..58f597657779b5a42010fba68d7f23a0acfd4a13
--- /dev/null
+++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp
@@ -0,0 +1,498 @@
+#include "MantidCurveFitting/PawleyFunction.h"
+
+#include "MantidAPI/FunctionFactory.h"
+#include "MantidKernel/UnitConversion.h"
+#include "MantidKernel/UnitFactory.h"
+
+#include <boost/algorithm/string.hpp>
+#include <boost/make_shared.hpp>
+
+namespace Mantid {
+namespace CurveFitting {
+
+DECLARE_FUNCTION(PawleyParameterFunction)
+
+using namespace API;
+using namespace Geometry;
+using namespace Kernel;
+
+/// Constructor
+PawleyParameterFunction::PawleyParameterFunction()
+    : ParamFunction(), m_crystalSystem(PointGroup::Triclinic),
+      m_profileFunctionCenterParameterName() {}
+
+/**
+ * @brief Sets the supplied attribute value
+ *
+ * The function calls ParamFunction::setAttribute, but performs additional
+ * actions for CrystalSystem and ProfileFunction.
+ *
+ * @param attName :: Name of the attribute
+ * @param attValue :: Value of the attribute
+ */
+void PawleyParameterFunction::setAttribute(const std::string &attName,
+                                           const Attribute &attValue) {
+  if (attName == "CrystalSystem") {
+    setCrystalSystem(attValue.asString());
+  } else if (attName == "ProfileFunction") {
+    setProfileFunction(attValue.asString());
+  }
+
+  ParamFunction::setAttribute(attName, attValue);
+}
+
+/// Returns the crystal system
+PointGroup::CrystalSystem PawleyParameterFunction::getCrystalSystem() const {
+  return m_crystalSystem;
+}
+
+/// Returns a UnitCell object constructed from the function's parameters.
+UnitCell PawleyParameterFunction::getUnitCellFromParameters() const {
+  switch (m_crystalSystem) {
+  case PointGroup::Cubic: {
+    double a = getParameter("a");
+    return UnitCell(a, a, a);
+  }
+  case PointGroup::Tetragonal: {
+    double a = getParameter("a");
+    return UnitCell(a, a, getParameter("c"));
+  }
+  case PointGroup::Hexagonal: {
+    double a = getParameter("a");
+    return UnitCell(a, a, getParameter("c"), 90, 90, 120);
+  }
+  case PointGroup::Trigonal: {
+    double a = getParameter("a");
+    double alpha = getParameter("Alpha");
+    return UnitCell(a, a, a, alpha, alpha, alpha);
+  }
+  case PointGroup::Orthorhombic: {
+    return UnitCell(getParameter("a"), getParameter("b"), getParameter("c"));
+  }
+  case PointGroup::Monoclinic: {
+    return UnitCell(getParameter("a"), getParameter("b"), getParameter("c"), 90,
+                    getParameter("Beta"), 90);
+  }
+  case PointGroup::Triclinic: {
+    return UnitCell(getParameter("a"), getParameter("b"), getParameter("c"),
+                    getParameter("Alpha"), getParameter("Beta"),
+                    getParameter("Gamma"));
+  }
+  }
+
+  return UnitCell();
+}
+
+/// Sets the function's parameters from the supplied UnitCell.
+void PawleyParameterFunction::setParametersFromUnitCell(const UnitCell &cell) {
+  // Parameter "a" exists in all crystal systems.
+  setParameter("a", cell.a());
+
+  try {
+    setParameter("b", cell.b());
+  }
+  catch (std::invalid_argument) {
+    // do nothing.
+  }
+
+  try {
+    setParameter("c", cell.c());
+  }
+  catch (std::invalid_argument) {
+    // do nothing
+  }
+
+  try {
+    setParameter("Alpha", cell.alpha());
+  }
+  catch (std::invalid_argument) {
+    // do nothing.
+  }
+  try {
+    setParameter("Beta", cell.beta());
+  }
+  catch (std::invalid_argument) {
+    // do nothing.
+  }
+  try {
+    setParameter("Gamma", cell.gamma());
+  }
+  catch (std::invalid_argument) {
+    // do nothing.
+  }
+}
+
+/// This method does nothing.
+void PawleyParameterFunction::function(const FunctionDomain &domain,
+                                       FunctionValues &values) const {
+  UNUSED_ARG(domain);
+  UNUSED_ARG(values);
+}
+
+/// This method does nothing.
+void PawleyParameterFunction::functionDeriv(const FunctionDomain &domain,
+                                            Jacobian &jacobian) {
+  UNUSED_ARG(domain)
+  UNUSED_ARG(jacobian);
+}
+
+/// Declares attributes and generates parameters based on the defaults.
+void PawleyParameterFunction::init() {
+  declareAttribute("CrystalSystem", IFunction::Attribute("Triclinic"));
+  declareAttribute("ProfileFunction", IFunction::Attribute("Gaussian"));
+
+  setCrystalSystem("Triclinic");
+  setProfileFunction("Gaussian");
+}
+
+/**
+ * Sets the profile function
+ *
+ * This method takes a function name and tries to create the corresponding
+ * function through FunctionFactory. Then it checks whether the function
+ * inherits from IPeakFunction and determines the centre parameter to store it.
+ *
+ * @param profileFunction :: Name of an IPeakFunction implementation.
+ */
+void PawleyParameterFunction::setProfileFunction(
+    const std::string &profileFunction) {
+  IPeakFunction_sptr peakFunction = boost::dynamic_pointer_cast<IPeakFunction>(
+      FunctionFactory::Instance().createFunction(profileFunction));
+
+  if (!peakFunction) {
+    throw std::invalid_argument("PawleyFunction can only use IPeakFunctions to "
+                                "calculate peak profiles.");
+  }
+
+  setCenterParameterNameFromFunction(peakFunction);
+}
+
+/**
+ * Assigns the crystal system
+ *
+ * This method takes the name of a crystal system (case insensitive) and stores
+ * it. Furthermore it creates the necessary parameters, which means that after
+ * calling this function, PawleyParameterFunction potentially exposes a
+ * different number of parameters.
+ *
+ * @param crystalSystem :: Crystal system, case insensitive.
+ */
+void
+PawleyParameterFunction::setCrystalSystem(const std::string &crystalSystem) {
+  std::string crystalSystemLC = boost::algorithm::to_lower_copy(crystalSystem);
+
+  if (crystalSystemLC == "cubic") {
+    m_crystalSystem = PointGroup::Cubic;
+  } else if (crystalSystemLC == "tetragonal") {
+    m_crystalSystem = PointGroup::Tetragonal;
+  } else if (crystalSystemLC == "hexagonal") {
+    m_crystalSystem = PointGroup::Hexagonal;
+  } else if (crystalSystemLC == "trigonal") {
+    m_crystalSystem = PointGroup::Trigonal;
+  } else if (crystalSystemLC == "orthorhombic") {
+    m_crystalSystem = PointGroup::Orthorhombic;
+  } else if (crystalSystemLC == "monoclinic") {
+    m_crystalSystem = PointGroup::Monoclinic;
+  } else if (crystalSystemLC == "triclinic") {
+    m_crystalSystem = PointGroup::Triclinic;
+  } else {
+    throw std::invalid_argument("Not a valid crystal system: '" +
+                                crystalSystem + "'.");
+  }
+
+  createCrystalSystemParameters(m_crystalSystem);
+}
+
+/// This method clears all parameters and declares parameters according to the
+/// supplied crystal system.
+void PawleyParameterFunction::createCrystalSystemParameters(
+    PointGroup::CrystalSystem crystalSystem) {
+
+  clearAllParameters();
+  switch (crystalSystem) {
+  case PointGroup::Cubic:
+    declareParameter("a", 1.0);
+    break;
+
+  case PointGroup::Hexagonal:
+  case PointGroup::Tetragonal:
+    declareParameter("a", 1.0);
+    declareParameter("c", 1.0);
+    break;
+
+  case PointGroup::Orthorhombic:
+    declareParameter("a", 1.0);
+    declareParameter("b", 1.0);
+    declareParameter("c", 1.0);
+    break;
+
+  case PointGroup::Monoclinic:
+    declareParameter("a", 1.0);
+    declareParameter("b", 1.0);
+    declareParameter("c", 1.0);
+    declareParameter("Beta", 90.0);
+    break;
+
+  case PointGroup::Trigonal:
+    declareParameter("a", 1.0);
+    declareParameter("Alpha", 90.0);
+    break;
+
+  default:
+    // triclinic
+    declareParameter("a", 1.0);
+    declareParameter("b", 1.0);
+    declareParameter("c", 1.0);
+
+    declareParameter("Alpha", 90.0);
+    declareParameter("Beta", 90.0);
+    declareParameter("Gamma", 90.0);
+    break;
+  }
+
+  declareParameter("ZeroShift", 0.0);
+}
+
+/// Tries to extract and store the center parameter name from the function.
+void PawleyParameterFunction::setCenterParameterNameFromFunction(
+    const IPeakFunction_sptr &profileFunction) {
+  m_profileFunctionCenterParameterName.clear();
+  if (profileFunction) {
+    m_profileFunctionCenterParameterName =
+        profileFunction->getCentreParameterName();
+  }
+}
+
+DECLARE_FUNCTION(PawleyFunction)
+
+/// Constructor
+PawleyFunction::PawleyFunction()
+    : FunctionParameterDecorator(), m_compositeFunction(),
+      m_pawleyParameterFunction(), m_peakProfileComposite(), m_hkls(),
+      m_dUnit(), m_wsUnit() {}
+
+void PawleyFunction::setMatrixWorkspace(
+    boost::shared_ptr<const MatrixWorkspace> workspace, size_t wi,
+    double startX, double endX) {
+  if (workspace) {
+    Axis *xAxis = workspace->getAxis(wi);
+    Kernel::Unit_sptr wsUnit = xAxis->unit();
+
+    if (boost::dynamic_pointer_cast<Units::Empty>(wsUnit) ||
+        boost::dynamic_pointer_cast<Units::dSpacing>(wsUnit)) {
+      m_wsUnit = m_dUnit;
+    } else {
+      double factor, power;
+      if (wsUnit->quickConversion(*m_dUnit, factor, power)) {
+        m_wsUnit = wsUnit;
+      } else {
+        throw std::invalid_argument("Can not use quick conversion for unit.");
+      }
+    }
+  }
+
+  m_wrappedFunction->setMatrixWorkspace(workspace, wi, startX, endX);
+}
+
+/// Sets the crystal system on the internal parameter function and updates the
+/// exposed parameters
+void PawleyFunction::setCrystalSystem(const std::string &crystalSystem) {
+  m_pawleyParameterFunction->setAttributeValue("CrystalSystem", crystalSystem);
+  m_compositeFunction->checkFunction();
+}
+
+/// Sets the profile function and replaces already existing functions in the
+/// internally stored CompositeFunction.
+void PawleyFunction::setProfileFunction(const std::string &profileFunction) {
+  m_pawleyParameterFunction->setAttributeValue("ProfileFunction",
+                                               profileFunction);
+
+  /* At this point PawleyParameterFunction guarantees that it's an IPeakFunction
+   * and all existing profile functions are replaced.
+   */
+  for (size_t i = 0; i < m_peakProfileComposite->nFunctions(); ++i) {
+    IPeakFunction_sptr oldFunction = boost::dynamic_pointer_cast<IPeakFunction>(
+        m_peakProfileComposite->getFunction(i));
+
+    IPeakFunction_sptr newFunction = boost::dynamic_pointer_cast<IPeakFunction>(
+        FunctionFactory::Instance().createFunction(
+            m_pawleyParameterFunction->getProfileFunctionName()));
+
+    newFunction->setCentre(oldFunction->centre());
+    try {
+      newFunction->setFwhm(oldFunction->fwhm());
+    }
+    catch (...) {
+      // do nothing.
+    }
+    newFunction->setHeight(oldFunction->height());
+
+    m_peakProfileComposite->replaceFunction(i, newFunction);
+  }
+
+  // Update exposed parameters.
+  m_compositeFunction->checkFunction();
+}
+
+/// Sets the unit cell from a string with either 6 or 3 space-separated numbers.
+void PawleyFunction::setUnitCell(const std::string &unitCellString) {
+  m_pawleyParameterFunction->setParametersFromUnitCell(
+      strToUnitCell(unitCellString));
+}
+
+/// Transform d value to workspace unit
+double PawleyFunction::getTransformedCenter(double d) const {
+  if ((m_dUnit && m_wsUnit) && m_dUnit != m_wsUnit) {
+    return UnitConversion::run(*m_dUnit, *m_wsUnit, d, 0, 0, 0,
+                               DeltaEMode::Elastic, 0);
+  }
+
+  return d;
+}
+
+/**
+ * Calculates the function values on the supplied domain
+ *
+ * This function is the core of PawleyFunction. It calculates the d-value for
+ * each stored HKL from the unit cell that is the result of the parameters
+ * stored in the internal PawleyParameterFunction and adds the ZeroShift
+ * parameter. The value is set as center parameter on the internally stored
+ * PeakFunctions.
+ *
+ * @param domain :: Function domain.
+ * @param values :: Function values.
+ */
+void PawleyFunction::function(const FunctionDomain &domain,
+                              FunctionValues &values) const {
+  UnitCell cell = m_pawleyParameterFunction->getUnitCellFromParameters();
+  double zeroShift = m_pawleyParameterFunction->getParameter("ZeroShift");
+
+  for (size_t i = 0; i < m_hkls.size(); ++i) {
+    double centre = getTransformedCenter(cell.d(m_hkls[i]));
+
+    m_peakProfileComposite->getFunction(i)->setParameter(
+        m_pawleyParameterFunction->getProfileFunctionCenterParameterName(),
+        centre + zeroShift);
+  }
+
+  m_peakProfileComposite->function(domain, values);
+}
+
+/// Removes all peaks from the function.
+void PawleyFunction::clearPeaks() {
+  m_peakProfileComposite = boost::dynamic_pointer_cast<CompositeFunction>(
+      FunctionFactory::Instance().createFunction("CompositeFunction"));
+  m_compositeFunction->replaceFunction(1, m_peakProfileComposite);
+  m_hkls.clear();
+}
+
+/// Clears peaks and adds a peak for each hkl, all with the same FWHM and
+/// height.
+void PawleyFunction::setPeaks(const std::vector<Kernel::V3D> &hkls, double fwhm,
+                              double height) {
+  clearPeaks();
+
+  for (size_t i = 0; i < hkls.size(); ++i) {
+    addPeak(hkls[i], fwhm, height);
+  }
+}
+
+/// Adds a peak with the supplied FWHM and height.
+void PawleyFunction::addPeak(const Kernel::V3D &hkl, double fwhm,
+                             double height) {
+  m_hkls.push_back(hkl);
+
+  IPeakFunction_sptr peak = boost::dynamic_pointer_cast<IPeakFunction>(
+      FunctionFactory::Instance().createFunction(
+          m_pawleyParameterFunction->getProfileFunctionName()));
+
+  peak->fix(peak->parameterIndex(
+      m_pawleyParameterFunction->getProfileFunctionCenterParameterName()));
+
+  try {
+    peak->setFwhm(fwhm);
+  }
+  catch (...) {
+    // do nothing.
+  }
+
+  peak->setHeight(height);
+
+  m_peakProfileComposite->addFunction(peak);
+
+  m_compositeFunction->checkFunction();
+}
+
+/// Returns the number of peaks that are stored in the function.
+size_t PawleyFunction::getPeakCount() const { return m_hkls.size(); }
+
+IPeakFunction_sptr PawleyFunction::getPeakFunction(size_t i) const {
+  if (i >= m_hkls.size()) {
+    throw std::out_of_range("Peak index out of range.");
+  }
+
+  return boost::dynamic_pointer_cast<IPeakFunction>(
+      m_peakProfileComposite->getFunction(i));
+}
+
+/// Return the HKL of the i-th peak.
+Kernel::V3D PawleyFunction::getPeakHKL(size_t i) const {
+  if (i >= m_hkls.size()) {
+    throw std::out_of_range("Peak index out of range.");
+  }
+
+  return m_hkls[i];
+}
+
+/// Returns the internally stored PawleyParameterFunction.
+PawleyParameterFunction_sptr
+PawleyFunction::getPawleyParameterFunction() const {
+  return m_pawleyParameterFunction;
+}
+
+void PawleyFunction::init() {
+  setDecoratedFunction("CompositeFunction");
+
+  if (!m_compositeFunction) {
+    throw std::runtime_error(
+        "PawleyFunction could not construct internal CompositeFunction.");
+  }
+
+  m_dUnit = UnitFactory::Instance().create("dSpacing");
+}
+
+/// Checks that the decorated function has the correct structure.
+void PawleyFunction::beforeDecoratedFunctionSet(const API::IFunction_sptr &fn) {
+  CompositeFunction_sptr composite =
+      boost::dynamic_pointer_cast<CompositeFunction>(fn);
+
+  if (!composite) {
+    throw std::invalid_argument("PawleyFunction only works with "
+                                "CompositeFunction. Selecting another "
+                                "decorated function is not possible.");
+  }
+
+  m_compositeFunction = composite;
+
+  if (m_compositeFunction->nFunctions() == 0) {
+    m_peakProfileComposite = boost::dynamic_pointer_cast<CompositeFunction>(
+        FunctionFactory::Instance().createFunction("CompositeFunction"));
+
+    m_pawleyParameterFunction =
+        boost::dynamic_pointer_cast<PawleyParameterFunction>(
+            FunctionFactory::Instance().createFunction(
+                "PawleyParameterFunction"));
+
+    m_compositeFunction->addFunction(m_pawleyParameterFunction);
+    m_compositeFunction->addFunction(m_peakProfileComposite);
+  } else {
+    m_pawleyParameterFunction =
+        boost::dynamic_pointer_cast<PawleyParameterFunction>(
+            m_compositeFunction->getFunction(0));
+    m_peakProfileComposite = boost::dynamic_pointer_cast<CompositeFunction>(
+        m_compositeFunction->getFunction(1));
+  }
+}
+
+} // namespace CurveFitting
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/CurveFitting/src/PseudoVoigt.cpp b/Code/Mantid/Framework/CurveFitting/src/PseudoVoigt.cpp
index 585d1d6eb8b025c6c5abd349ecbc3da5d1f0b1d4..a492df6add6514a4888fc8eb88b80719fd5c99dd 100644
--- a/Code/Mantid/Framework/CurveFitting/src/PseudoVoigt.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/PseudoVoigt.cpp
@@ -9,7 +9,7 @@ namespace CurveFitting {
 
 using namespace API;
 
-DECLARE_FUNCTION(PseudoVoigt);
+DECLARE_FUNCTION(PseudoVoigt)
 
 void PseudoVoigt::functionLocal(double *out, const double *xValues,
                                 const size_t nData) const {
diff --git a/Code/Mantid/Framework/CurveFitting/src/SplineInterpolation.cpp b/Code/Mantid/Framework/CurveFitting/src/SplineInterpolation.cpp
index 266f44f7e91977c707b34efbc70cf5778c78fae1..d476c8013e8ae2d95eb1e43a4416990512d68a4f 100644
--- a/Code/Mantid/Framework/CurveFitting/src/SplineInterpolation.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/SplineInterpolation.cpp
@@ -7,7 +7,7 @@ namespace Mantid {
 namespace CurveFitting {
 
 // Register the algorithm into the AlgorithmFactory
-DECLARE_ALGORITHM(SplineInterpolation);
+DECLARE_ALGORITHM(SplineInterpolation)
 
 using namespace API;
 using namespace Kernel;
diff --git a/Code/Mantid/Framework/CurveFitting/src/SplineSmoothing.cpp b/Code/Mantid/Framework/CurveFitting/src/SplineSmoothing.cpp
index 0d1f3d560a032830bfe1134b30b152e629e8a2b0..cd8f927f1b604c449bffd99f6cc62acc2d04dc88 100644
--- a/Code/Mantid/Framework/CurveFitting/src/SplineSmoothing.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/SplineSmoothing.cpp
@@ -12,7 +12,7 @@ namespace Mantid {
 namespace CurveFitting {
 
 // Register the algorithm into the AlgorithmFactory
-DECLARE_ALGORITHM(SplineSmoothing);
+DECLARE_ALGORITHM(SplineSmoothing)
 
 using namespace API;
 using namespace Kernel;
@@ -32,10 +32,10 @@ SplineSmoothing::~SplineSmoothing() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string SplineSmoothing::name() const { return "SplineSmoothing"; };
+const std::string SplineSmoothing::name() const { return "SplineSmoothing"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int SplineSmoothing::version() const { return 1; };
+int SplineSmoothing::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string SplineSmoothing::category() const {
diff --git a/Code/Mantid/Framework/CurveFitting/src/VesuvioResolution.cpp b/Code/Mantid/Framework/CurveFitting/src/VesuvioResolution.cpp
index d13a8297536cd0b4c8b449ed244b9839b2f9f03c..fac486c744a48fe86404b42778814178c39cf36a 100644
--- a/Code/Mantid/Framework/CurveFitting/src/VesuvioResolution.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/VesuvioResolution.cpp
@@ -17,7 +17,7 @@ const double STDDEV_TO_HWHM = std::sqrt(std::log(4.0));
 }
 
 // Register into factory
-DECLARE_FUNCTION(VesuvioResolution);
+DECLARE_FUNCTION(VesuvioResolution)
 
 //---------------------------------------------------------------------------
 // Static functions
diff --git a/Code/Mantid/Framework/CurveFitting/src/Voigt.cpp b/Code/Mantid/Framework/CurveFitting/src/Voigt.cpp
index fd520534558927fcaa9c7774dec5890c1856bc39..9e006da4d314d97a44efe6c8f7f5bcc3b4b0a90a 100644
--- a/Code/Mantid/Framework/CurveFitting/src/Voigt.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/Voigt.cpp
@@ -9,7 +9,7 @@
 
 namespace Mantid {
 namespace CurveFitting {
-DECLARE_FUNCTION(Voigt);
+DECLARE_FUNCTION(Voigt)
 
 namespace {
 /// @cond
diff --git a/Code/Mantid/Framework/CurveFitting/test/CompositeFunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/CompositeFunctionTest.h
index ec353f5b2a615980b91c14d425e3f1d7be850107..678334f2bd1977656e19c70810d8de5744224125 100644
--- a/Code/Mantid/Framework/CurveFitting/test/CompositeFunctionTest.h
+++ b/Code/Mantid/Framework/CurveFitting/test/CompositeFunctionTest.h
@@ -135,8 +135,8 @@ public:
 
 };
 
-DECLARE_FUNCTION(CurveFittingLinear);
-DECLARE_FUNCTION(CurveFittingGauss);
+DECLARE_FUNCTION(CurveFittingLinear)
+DECLARE_FUNCTION(CurveFittingGauss)
 
 class CompositeFunctionTest : public CxxTest::TestSuite
 {
diff --git a/Code/Mantid/Framework/CurveFitting/test/ConvolutionTest.h b/Code/Mantid/Framework/CurveFitting/test/ConvolutionTest.h
index afc285cfb1c4a223664573745554a39e2126ca52..c548fc16127312fb5a819bb7bfb6661fd06c9bba 100644
--- a/Code/Mantid/Framework/CurveFitting/test/ConvolutionTest.h
+++ b/Code/Mantid/Framework/CurveFitting/test/ConvolutionTest.h
@@ -191,9 +191,9 @@ public:
 
 };
 
-DECLARE_FUNCTION(ConvolutionTest_Gauss);
-DECLARE_FUNCTION(ConvolutionTest_Lorentz);
-DECLARE_FUNCTION(ConvolutionTest_Linear);
+DECLARE_FUNCTION(ConvolutionTest_Gauss)
+DECLARE_FUNCTION(ConvolutionTest_Lorentz)
+DECLARE_FUNCTION(ConvolutionTest_Linear)
 
 class ConvolutionTest : public CxxTest::TestSuite
 {
diff --git a/Code/Mantid/Framework/CurveFitting/test/DiffRotDiscreteCircleTest.h b/Code/Mantid/Framework/CurveFitting/test/DiffRotDiscreteCircleTest.h
index 8eeffacaaff2ee5a3ce466cc19c51a99599e4bdf..f0dba53f28f99738d4381d304362bf3ccdc9f5d1 100644
--- a/Code/Mantid/Framework/CurveFitting/test/DiffRotDiscreteCircleTest.h
+++ b/Code/Mantid/Framework/CurveFitting/test/DiffRotDiscreteCircleTest.h
@@ -25,6 +25,7 @@ public:
   static DiffRotDiscreteCircleTest *createSuite() { return new DiffRotDiscreteCircleTest(); }
   static void destroySuite( DiffRotDiscreteCircleTest *suite ) { delete suite; }
 
+
   // convolve the elastic part with a resolution function, here a Gaussian
   void testDiffRotDiscreteCircleElastic()
   {
@@ -75,58 +76,17 @@ public:
   } // testDiffRotDiscreteCircleElastic
 
 
-  /// Fit the convolution of the inelastic part with a Gaussian resolution function
   void testDiffRotDiscreteCircleInelastic()
   {
-    /* Note: it turns out that parameters Intensity and Radius are highly covariant, so that more than one minimum exists.
-     * Thus, I tied parameter Radius. This is OK since one usually knows the radius of the circle of the jumping diffusion
-     */
-
-    // initialize the fitting function in a Fit algorithm
-    // Parameter units are assumed in micro-eV, Angstroms, Angstroms**(-1), and nano-seconds. Intensities have arbitrary units
-    std::string funtion_string = "(composite=Convolution,FixResolution=true,NumDeriv=true;name=Gaussian,Height=1.0,PeakCentre=0.0,Sigma=20.0,ties=(Height=1.0,PeakCentre=0.0,Sigma=20.0);name=InelasticDiffRotDiscreteCircle,N=3,Q=0.5,Intensity=47.014,Radius=1.567,Decay=7.567)";
-
-    // Initialize the fit function in the Fit algorithm
-    Mantid::CurveFitting::Fit fitalg;
-    TS_ASSERT_THROWS_NOTHING( fitalg.initialize() );
-    TS_ASSERT( fitalg.isInitialized() );
-    fitalg.setProperty( "Function", funtion_string );
-
-    // create the data workspace by evaluating the fit function in the Fit algorithm
-    auto data_workspace = generateWorkspaceFromFitAlgorithm( fitalg );
-    //saveWorkspace( data_workspace, "/tmp/junk.nxs" ); // for debugging purposes only
-
-    //override the function with new parameters, then do the Fit
-    funtion_string = "(composite=Convolution,FixResolution=true,NumDeriv=true;name=Gaussian,Height=1.0,PeakCentre=0.0,Sigma=20.0,ties=(Height=1.0,PeakCentre=0.0,Sigma=20.0);name=InelasticDiffRotDiscreteCircle,N=3,Q=0.5,Intensity=10.0,Radius=1.567,Decay=20.0,ties=(Radius=1.567))";
-    fitalg.setProperty( "Function", funtion_string );
-    fitalg.setProperty( "InputWorkspace", data_workspace );
-    fitalg.setPropertyValue( "WorkspaceIndex", "0" );
-    TS_ASSERT_THROWS_NOTHING( TS_ASSERT( fitalg.execute() ) );
-    TS_ASSERT( fitalg.isExecuted() );
+    runDiffRotDiscreteCircleInelasticTest(0.0);
+  }
 
-    // check Chi-square is small
-    const double chi_squared = fitalg.getProperty("OutputChi2overDoF");
-    TS_ASSERT_LESS_THAN( chi_squared, 0.001 );
-    //std::cout << "\nchi_squared = " << chi_squared << "\n"; // only for debugging purposes
 
-    // check the parameters of the resolution did not change
-    Mantid::API::IFunction_sptr fitalg_function = fitalg.getProperty( "Function" );
-    auto fitalg_conv = boost::dynamic_pointer_cast<Mantid::CurveFitting::Convolution>( fitalg_function ) ;
-    Mantid::API::IFunction_sptr fitalg_resolution = fitalg_conv->getFunction( 0 );
-    TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "PeakCentre" ), 0.0, 0.00001 );  // allow for a small percent variation
-    TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Height" ), 1.0,  1.0 * 0.001 ); // allow for a small percent variation
-    TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Sigma" ), 20.0,  20.0* 0.001 ); // allow for a small percent variation
-    //std::cout << "\nPeakCentre = " << fitalg_resolution->getParameter("PeakCentre") << "  Height= " << fitalg_resolution->getParameter("Height") << "  Sigma=" << fitalg_resolution->getParameter("Sigma") << "\n"; // only for debugging purposes
-
-    // check the parameters of the inelastic part
-    Mantid::API::IFunction_sptr fitalg_structure_factor = fitalg_conv->getFunction( 1 );
-    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Intensity" ), 47.014, 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, 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
-    //std::cout << "OPTIMIZED: Intensity = " << fitalg_structure_factor->getParameter("Intensity") << "  Radius = " << fitalg_structure_factor->getParameter("Radius") << "  Decay = " << fitalg_structure_factor->getParameter("Decay") << "\n"; // only for debugging purposes
+  void testDiffRotDiscreteCircleInelasticWithShift()
+  {
+    runDiffRotDiscreteCircleInelasticTest(0.5);
+  }
 
-  } // testDiffRotDiscreteCircleElastic
 
   /* Check the particular case for N = 3
    * In this case, the inelastic part should reduce to a single Lorentzian in 'w':
@@ -293,6 +253,79 @@ public:
 
 
 private:
+  /// Fit the convolution of the inelastic part with a Gaussian resolution function
+  void runDiffRotDiscreteCircleInelasticTest(const double S)
+  {
+    /* Note: it turns out that parameters Intensity and Radius are highly covariant, so that more than one minimum exists.
+     * Thus, I tied parameter Radius. This is OK since one usually knows the radius of the circle of the jumping diffusion
+     */
+    const double I(47.014);
+    const double R(1.567);
+    const double tao(7.567);
+
+    // initialize the fitting function in a Fit algorithm
+    // Parameter units are assumed in micro-eV, Angstroms, Angstroms**(-1), and nano-seconds. Intensities have arbitrary units
+    std::ostringstream function_stream;
+    function_stream << "(composite=Convolution,FixResolution=true,NumDeriv=true;"
+                    << "name=Gaussian,Height=1.0,PeakCentre=0.0,Sigma=20.0,"
+                    << "ties=(Height=1.0,PeakCentre=0.0,Sigma=20.0);"
+                    << "name=InelasticDiffRotDiscreteCircle,N=3,Q=0.5,"
+                    << "Intensity=" << I
+                    << ",Radius=" << R
+                    << ",Decay=" << tao
+                    << ",Shift=" << S << ")";
+
+    // Initialize the fit function in the Fit algorithm
+    Mantid::CurveFitting::Fit fitalg;
+    TS_ASSERT_THROWS_NOTHING( fitalg.initialize() );
+    TS_ASSERT( fitalg.isInitialized() );
+    fitalg.setProperty( "Function", function_stream.str() );
+
+    function_stream.str( std::string() );
+    function_stream.clear();
+
+    // create the data workspace by evaluating the fit function in the Fit algorithm
+    auto data_workspace = generateWorkspaceFromFitAlgorithm( fitalg );
+    //saveWorkspace( data_workspace, "/tmp/junk.nxs" ); // for debugging purposes only
+
+    //override the function with new parameters, then do the Fit
+    function_stream << "(composite=Convolution,FixResolution=true,NumDeriv=true;"
+                   << "name=Gaussian,Height=1.0,PeakCentre=0.0,Sigma=20.0,"
+                   << "ties=(Height=1.0,PeakCentre=0.0,Sigma=20.0);"
+                   << "name=InelasticDiffRotDiscreteCircle,N=3,Q=0.5,"
+                   << "Intensity=10.0,Radius=1.567,Decay=20.0"
+                   << ",ties=(Radius=" << R << "))";
+    fitalg.setProperty( "Function", function_stream.str() );
+    fitalg.setProperty( "InputWorkspace", data_workspace );
+    fitalg.setPropertyValue( "WorkspaceIndex", "0" );
+    TS_ASSERT_THROWS_NOTHING( TS_ASSERT( fitalg.execute() ) );
+    TS_ASSERT( fitalg.isExecuted() );
+
+    // check Chi-square is small
+    const double chi_squared = fitalg.getProperty("OutputChi2overDoF");
+    TS_ASSERT_LESS_THAN( chi_squared, 0.001 );
+    //std::cout << "\nchi_squared = " << chi_squared << "\n"; // only for debugging purposes
+
+    // check the parameters of the resolution did not change
+    Mantid::API::IFunction_sptr fitalg_function = fitalg.getProperty( "Function" );
+    auto fitalg_conv = boost::dynamic_pointer_cast<Mantid::CurveFitting::Convolution>( fitalg_function ) ;
+    Mantid::API::IFunction_sptr fitalg_resolution = fitalg_conv->getFunction( 0 );
+    TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "PeakCentre" ), 0.0, 0.00001 );  // allow for a small percent variation
+    TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Height" ), 1.0,  1.0 * 0.001 ); // allow for a small percent variation
+    TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Sigma" ), 20.0,  20.0* 0.001 ); // allow for a small percent variation
+    //std::cout << "\nPeakCentre = " << fitalg_resolution->getParameter("PeakCentre") << "  Height= " << fitalg_resolution->getParameter("Height") << "  Sigma=" << fitalg_resolution->getParameter("Sigma") << "\n"; // only for debugging purposes
+
+    // check the parameters of the inelastic part
+    Mantid::API::IFunction_sptr fitalg_structure_factor = fitalg_conv->getFunction( 1 );
+    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Intensity" ), I, I * 0.05 ); // allow for a small percent variation
+    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Radius" ), R, R * 0.05 );      // allow for a small percent variation
+    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Decay" ), tao, tao * 0.05 );       // allow for a small percent variation
+    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Shift" ), S, 0.00001 );       // allow for a small percent variation
+    //std::cout << "\nGOAL: Intensity = 47.014,  Radius = 1.567,  Decay = 7.567\n"; // only for debugging purposes
+    //std::cout << "OPTIMIZED: Intensity = " << fitalg_structure_factor->getParameter("Intensity") << "  Radius = " << fitalg_structure_factor->getParameter("Radius") << "  Decay = " << fitalg_structure_factor->getParameter("Decay") << "\n"; // only for debugging purposes
+
+  } // runDiffRotDiscreteCircleInelasticTest
+
 
   /// returns a real value from a uniform distribution
   double random_value(const double & a, const double & b)
diff --git a/Code/Mantid/Framework/CurveFitting/test/DiffSphereTest.h b/Code/Mantid/Framework/CurveFitting/test/DiffSphereTest.h
index 6b0baeaf008b354ae2bb6877dafca59dda518ee1..9242cb31729d2bfc9737e255c02933353190efa4 100644
--- a/Code/Mantid/Framework/CurveFitting/test/DiffSphereTest.h
+++ b/Code/Mantid/Framework/CurveFitting/test/DiffSphereTest.h
@@ -128,7 +128,17 @@ public:
 
   void testDiffSphereInelastic()
   {
-    // target fitting parameters
+    runDiffSphereInelasticTest(0.0);
+  }
+
+  void testDiffSphereInelasticWithShift()
+  {
+    runDiffSphereInelasticTest(0.2);
+  }
+
+  void testDiffSphere()
+  {
+    // target parameters
     const double I_0(47.014);
     const double R_0(2.1);
     const double D_0(0.049);
@@ -141,14 +151,32 @@ public:
     std::ostringstream funtion_stream;
     funtion_stream << "(composite=Convolution,FixResolution=true,NumDeriv=true;name=Gaussian,Height=1.0,"
         << "PeakCentre=0.0,Sigma=0.002,ties=(Height=1.0,PeakCentre=0.0,Sigma=0.002);"
-        << "name=InelasticDiffSphere,Q=" << boost::lexical_cast<std::string>( Q ) << ",Intensity="
+        << "name=DiffSphere,Q=" << boost::lexical_cast<std::string>( Q ) << ",Intensity="
         << boost::lexical_cast<std::string>( I_0 ) << ",Radius=" << boost::lexical_cast<std::string>( R_0 )
         << ",Diffusion=" << boost::lexical_cast<std::string>( D_0 ) << ")";
     fitalg.setProperty( "Function", funtion_stream.str() );
 
-    // create the data workspace by evaluating the fit function in the Fit algorithm
-    auto data_workspace = generateWorkspaceFromFitAlgorithm( fitalg );
-    //saveWorkspace( data_workspace, "/tmp/junk_data.nxs" ); // for debugging purposes only
+    // Find out whether ties were correctly applied
+    Mantid::API::IFunction_sptr fitalg_function = fitalg.getProperty( "Function" ); // main function
+    fitalg_function->initialize();
+    auto fitalg_conv = boost::dynamic_pointer_cast<Mantid::CurveFitting::Convolution>( fitalg_function ) ; // cast to Convolution
+    fitalg_function = fitalg_conv->getFunction( 1 ); // DiffSphere
+    auto fitalg_structure_factor = boost::dynamic_pointer_cast<Mantid::CurveFitting::DiffSphere>( fitalg_function );
+
+    fitalg_function = fitalg_structure_factor->getFunction( 0 );
+    auto fitalg_elastic = boost::dynamic_pointer_cast<Mantid::CurveFitting::ElasticDiffSphere>( fitalg_function ) ;
+    TS_ASSERT_DELTA( fitalg_elastic -> getParameter( "Height" ), I_0, std::numeric_limits<double>::epsilon() );
+    TS_ASSERT_DELTA( fitalg_elastic -> getParameter( "Radius" ), R_0, std::numeric_limits<double>::epsilon() );
+    TS_ASSERT_DELTA( fitalg_elastic -> getAttribute( "Q" ).asDouble(), Q, std::numeric_limits<double>::epsilon() );
+    //std::cout << "Height=" << fitalg_elastic -> getParameter( "Height" ) << " Radius=" << fitalg_elastic -> getParameter( "Radius" ) << "\n"; // for debugging purposes only
+
+    fitalg_function = fitalg_structure_factor->getFunction( 1 );
+    auto fitalg_inelastic = boost::dynamic_pointer_cast<Mantid::CurveFitting::InelasticDiffSphere>( fitalg_function ) ;
+    TS_ASSERT_DELTA( fitalg_inelastic -> getParameter( "Intensity" ), I_0, std::numeric_limits<double>::epsilon() );
+    TS_ASSERT_DELTA( fitalg_inelastic -> getParameter( "Radius" ), R_0, std::numeric_limits<double>::epsilon() );
+    TS_ASSERT_DELTA( fitalg_inelastic -> getParameter( "Diffusion" ), D_0, std::numeric_limits<double>::epsilon() );
+    TS_ASSERT_DELTA( fitalg_inelastic -> getAttribute( "Q" ).asDouble(), Q, std::numeric_limits<double>::epsilon() );
+    //std::cout << "Intensity=" << fitalg_inelastic->getParameter( "Intensity" ) << " Radius=" << fitalg_inelastic->getParameter( "Radius" ) << " Diffusion=" << fitalg_inelastic->getParameter( "Diffusion" ) <<"\n"; // for debugging purposes only
 
     // override the function with new parameters, our initial guess.
     double I = I_0 * ( 0.75 + ( 0.5 * std::rand() ) / RAND_MAX );
@@ -158,20 +186,20 @@ public:
     funtion_stream.clear();
     funtion_stream << "(composite=Convolution,FixResolution=true,NumDeriv=true;name=Gaussian,Height=1.0,"
         << "PeakCentre=0.0,Sigma=0.002,ties=(Height=1.0,PeakCentre=0.0,Sigma=0.002);"
-        << "name=InelasticDiffSphere,Q=" << boost::lexical_cast<std::string>( Q ) << ",Intensity="
+        << "name=DiffSphere,Q=" << boost::lexical_cast<std::string>( Q ) << ",Intensity="
         << boost::lexical_cast<std::string>( I ) << ",Radius=" << boost::lexical_cast<std::string>( R )
         << ",Diffusion=" << boost::lexical_cast<std::string>( D ) << ")";
     fitalg.setProperty( "Function", funtion_stream.str() );
-    //auto before_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); // for debugging purposes only
-    //saveWorkspace( before_workspace, "/tmp/junk_before_fitting.nxs" ); // for debugging purposes only
+
+    // create the data workspace by evaluating the fit function in the Fit algorithm
+    auto data_workspace = generateWorkspaceFromFitAlgorithm( fitalg );
+    //saveWorkspace( data_workspace, "/tmp/junk_data.nxs" ); // for debugging purposes only
 
     // Do the fit
     fitalg.setProperty( "InputWorkspace", data_workspace );
     fitalg.setPropertyValue( "WorkspaceIndex", "0" );
     TS_ASSERT_THROWS_NOTHING( TS_ASSERT( fitalg.execute() ) );
     TS_ASSERT( fitalg.isExecuted() );
-    //auto after_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); // for debugging purposes only
-    //saveWorkspace( after_workspace, "/tmp/junk_after_fitting.nxs" ); // for debugging purposes only
 
     // check Chi-square is small
     const double chi_squared = fitalg.getProperty("OutputChi2overDoF");
@@ -179,28 +207,25 @@ public:
     //std::cout << "\nchi_squared = " << chi_squared << "\n"; // only for debugging purposes
 
     // check the parameters of the resolution did not change
-    Mantid::API::IFunction_sptr fitalg_function = fitalg.getProperty( "Function" );
-    auto fitalg_conv = boost::dynamic_pointer_cast<Mantid::CurveFitting::Convolution>( fitalg_function ) ;
     Mantid::API::IFunction_sptr fitalg_resolution = fitalg_conv->getFunction( 0 );
-
     TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "PeakCentre" ), 0.0, 0.00001 );  // allow for a small percent variation
     TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Height" ), 1.0,  1.0 * 0.001 ); // allow for a small percent variation
     TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Sigma" ), 0.002,  0.002* 0.001 ); // allow for a small percent variation
     //std::cout << "\nPeakCentre = " << fitalg_resolution->getParameter("PeakCentre") << "  Height= " << fitalg_resolution->getParameter("Height") << "  Sigma=" << fitalg_resolution->getParameter("Sigma") << "\n"; // only for debugging purposes
 
-    // check the parameters of the inelastic part close to the target parameters
-    Mantid::API::IFunction_sptr fitalg_structure_factor = fitalg_conv->getFunction( 1 );
+    // check the parameters of the DiffSphere close to the target parameters
     TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Intensity" ), I_0, I_0 * 0.05 ); // allow for a small percent variation
-    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Radius" ), R_0, R_0 * 0.05 );      // allow for a small percent variation
-    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Diffusion" ), D_0, D_0 * 0.05 );      // allow for a small percent variation
+    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Radius" ), R_0, R_0 * 0.05 ); // allow for a small percent variation
+    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Diffusion" ), D_0, D_0 * 0.05 ); // allow for a small percent variation
     //std::cout << "\nINITIAL GUESS: Intensity = "<<boost::lexical_cast<std::string>(I)<<",  Radius ="<<boost::lexical_cast<std::string>(R)<<",  Diffusion = "<<boost::lexical_cast<std::string>(D)<<"\n"; // only for debugging purposes
     //std::cout << "GOAL: Intensity = "<<boost::lexical_cast<std::string>(I_0)<<",  Radius = "<<boost::lexical_cast<std::string>(R_0)<<",  Diffusion = "<<boost::lexical_cast<std::string>(D_0)<<"\n"; // only for debugging purposes
     //std::cout << "OPTIMIZED: Intensity = " << fitalg_structure_factor->getParameter("Intensity") << "  Radius = " << fitalg_structure_factor->getParameter("Radius") << "  Diffusion = " << fitalg_structure_factor->getParameter("Diffusion") << "\n"; // only for debugging purposes
   }
 
-  void testDiffSphere()
+private:
+  void runDiffSphereInelasticTest(const double S)
   {
-    // target parameters
+    // target fitting parameters
     const double I_0(47.014);
     const double R_0(2.1);
     const double D_0(0.049);
@@ -212,33 +237,16 @@ public:
     TS_ASSERT( fitalg.isInitialized() );
     std::ostringstream funtion_stream;
     funtion_stream << "(composite=Convolution,FixResolution=true,NumDeriv=true;name=Gaussian,Height=1.0,"
-        << "PeakCentre=0.0,Sigma=0.002,ties=(Height=1.0,PeakCentre=0.0,Sigma=0.002);"
-        << "name=DiffSphere,Q=" << boost::lexical_cast<std::string>( Q ) << ",Intensity="
+        << "PeakCentre=0.0,Sigma=0.002,ties=(Height=1.0,PeakCentre=" << S << ",Sigma=0.002);"
+        << "name=InelasticDiffSphere,Q=" << boost::lexical_cast<std::string>( Q ) << ",Intensity="
         << boost::lexical_cast<std::string>( I_0 ) << ",Radius=" << boost::lexical_cast<std::string>( R_0 )
-        << ",Diffusion=" << boost::lexical_cast<std::string>( D_0 ) << ")";
+        << ",Diffusion=" << boost::lexical_cast<std::string>( D_0 )
+        << ",Shift=" << boost::lexical_cast<std::string>(S) << ")";
     fitalg.setProperty( "Function", funtion_stream.str() );
 
-    // Find out whether ties were correctly applied
-    Mantid::API::IFunction_sptr fitalg_function = fitalg.getProperty( "Function" ); // main function
-    fitalg_function->initialize();
-    auto fitalg_conv = boost::dynamic_pointer_cast<Mantid::CurveFitting::Convolution>( fitalg_function ) ; // cast to Convolution
-    fitalg_function = fitalg_conv->getFunction( 1 ); // DiffSphere
-    auto fitalg_structure_factor = boost::dynamic_pointer_cast<Mantid::CurveFitting::DiffSphere>( fitalg_function );
-
-    fitalg_function = fitalg_structure_factor->getFunction( 0 );
-    auto fitalg_elastic = boost::dynamic_pointer_cast<Mantid::CurveFitting::ElasticDiffSphere>( fitalg_function ) ;
-    TS_ASSERT_DELTA( fitalg_elastic -> getParameter( "Height" ), I_0, std::numeric_limits<double>::epsilon() );
-    TS_ASSERT_DELTA( fitalg_elastic -> getParameter( "Radius" ), R_0, std::numeric_limits<double>::epsilon() );
-    TS_ASSERT_DELTA( fitalg_elastic -> getAttribute( "Q" ).asDouble(), Q, std::numeric_limits<double>::epsilon() );
-    //std::cout << "Height=" << fitalg_elastic -> getParameter( "Height" ) << " Radius=" << fitalg_elastic -> getParameter( "Radius" ) << "\n"; // for debugging purposes only
-
-    fitalg_function = fitalg_structure_factor->getFunction( 1 );
-    auto fitalg_inelastic = boost::dynamic_pointer_cast<Mantid::CurveFitting::InelasticDiffSphere>( fitalg_function ) ;
-    TS_ASSERT_DELTA( fitalg_inelastic -> getParameter( "Intensity" ), I_0, std::numeric_limits<double>::epsilon() );
-    TS_ASSERT_DELTA( fitalg_inelastic -> getParameter( "Radius" ), R_0, std::numeric_limits<double>::epsilon() );
-    TS_ASSERT_DELTA( fitalg_inelastic -> getParameter( "Diffusion" ), D_0, std::numeric_limits<double>::epsilon() );
-    TS_ASSERT_DELTA( fitalg_inelastic -> getAttribute( "Q" ).asDouble(), Q, std::numeric_limits<double>::epsilon() );
-    //std::cout << "Intensity=" << fitalg_inelastic->getParameter( "Intensity" ) << " Radius=" << fitalg_inelastic->getParameter( "Radius" ) << " Diffusion=" << fitalg_inelastic->getParameter( "Diffusion" ) <<"\n"; // for debugging purposes only
+    // create the data workspace by evaluating the fit function in the Fit algorithm
+    auto data_workspace = generateWorkspaceFromFitAlgorithm( fitalg );
+    //saveWorkspace( data_workspace, "/tmp/junk_data.nxs" ); // for debugging purposes only
 
     // override the function with new parameters, our initial guess.
     double I = I_0 * ( 0.75 + ( 0.5 * std::rand() ) / RAND_MAX );
@@ -247,21 +255,22 @@ public:
     funtion_stream.str( std::string() );
     funtion_stream.clear();
     funtion_stream << "(composite=Convolution,FixResolution=true,NumDeriv=true;name=Gaussian,Height=1.0,"
-        << "PeakCentre=0.0,Sigma=0.002,ties=(Height=1.0,PeakCentre=0.0,Sigma=0.002);"
-        << "name=DiffSphere,Q=" << boost::lexical_cast<std::string>( Q ) << ",Intensity="
+        << "PeakCentre=0.0,Sigma=0.002,ties=(Height=1.0,PeakCentre=" << S << ",Sigma=0.002);"
+        << "name=InelasticDiffSphere,Q=" << boost::lexical_cast<std::string>( Q ) << ",Intensity="
         << boost::lexical_cast<std::string>( I ) << ",Radius=" << boost::lexical_cast<std::string>( R )
-        << ",Diffusion=" << boost::lexical_cast<std::string>( D ) << ")";
+        << ",Diffusion=" << boost::lexical_cast<std::string>( D )
+        << ",Shift=" << boost::lexical_cast<std::string>(S) << ")";
     fitalg.setProperty( "Function", funtion_stream.str() );
-
-    // create the data workspace by evaluating the fit function in the Fit algorithm
-    auto data_workspace = generateWorkspaceFromFitAlgorithm( fitalg );
-    //saveWorkspace( data_workspace, "/tmp/junk_data.nxs" ); // for debugging purposes only
+    //auto before_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); // for debugging purposes only
+    //saveWorkspace( before_workspace, "/tmp/junk_before_fitting.nxs" ); // for debugging purposes only
 
     // Do the fit
     fitalg.setProperty( "InputWorkspace", data_workspace );
     fitalg.setPropertyValue( "WorkspaceIndex", "0" );
     TS_ASSERT_THROWS_NOTHING( TS_ASSERT( fitalg.execute() ) );
     TS_ASSERT( fitalg.isExecuted() );
+    //auto after_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); // for debugging purposes only
+    //saveWorkspace( after_workspace, "/tmp/junk_after_fitting.nxs" ); // for debugging purposes only
 
     // check Chi-square is small
     const double chi_squared = fitalg.getProperty("OutputChi2overDoF");
@@ -269,24 +278,26 @@ public:
     //std::cout << "\nchi_squared = " << chi_squared << "\n"; // only for debugging purposes
 
     // check the parameters of the resolution did not change
+    Mantid::API::IFunction_sptr fitalg_function = fitalg.getProperty( "Function" );
+    auto fitalg_conv = boost::dynamic_pointer_cast<Mantid::CurveFitting::Convolution>( fitalg_function ) ;
     Mantid::API::IFunction_sptr fitalg_resolution = fitalg_conv->getFunction( 0 );
-    TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "PeakCentre" ), 0.0, 0.00001 );  // allow for a small percent variation
+
+    TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "PeakCentre" ), S, 0.00001 );  // allow for a small percent variation
     TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Height" ), 1.0,  1.0 * 0.001 ); // allow for a small percent variation
     TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Sigma" ), 0.002,  0.002* 0.001 ); // allow for a small percent variation
     //std::cout << "\nPeakCentre = " << fitalg_resolution->getParameter("PeakCentre") << "  Height= " << fitalg_resolution->getParameter("Height") << "  Sigma=" << fitalg_resolution->getParameter("Sigma") << "\n"; // only for debugging purposes
 
-    // check the parameters of the DiffSphere close to the target parameters
+    // check the parameters of the inelastic part close to the target parameters
+    Mantid::API::IFunction_sptr fitalg_structure_factor = fitalg_conv->getFunction( 1 );
     TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Intensity" ), I_0, I_0 * 0.05 ); // allow for a small percent variation
-    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Radius" ), R_0, R_0 * 0.05 ); // allow for a small percent variation
-    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Diffusion" ), D_0, D_0 * 0.05 ); // allow for a small percent variation
+    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Radius" ), R_0, R_0 * 0.05 );      // allow for a small percent variation
+    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Diffusion" ), D_0, D_0 * 0.05 );      // allow for a small percent variation
+    TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Shift" ), S, 0.0005 );      // allow for a small percent variation
     //std::cout << "\nINITIAL GUESS: Intensity = "<<boost::lexical_cast<std::string>(I)<<",  Radius ="<<boost::lexical_cast<std::string>(R)<<",  Diffusion = "<<boost::lexical_cast<std::string>(D)<<"\n"; // only for debugging purposes
     //std::cout << "GOAL: Intensity = "<<boost::lexical_cast<std::string>(I_0)<<",  Radius = "<<boost::lexical_cast<std::string>(R_0)<<",  Diffusion = "<<boost::lexical_cast<std::string>(D_0)<<"\n"; // only for debugging purposes
     //std::cout << "OPTIMIZED: Intensity = " << fitalg_structure_factor->getParameter("Intensity") << "  Radius = " << fitalg_structure_factor->getParameter("Radius") << "  Diffusion = " << fitalg_structure_factor->getParameter("Diffusion") << "\n"; // only for debugging purposes
-
   }
 
-private:
-
   /// save a worskapece to a nexus file
   void saveWorkspace( Mantid::DataObjects::Workspace2D_sptr &ws, const std::string &filename )
   {
diff --git a/Code/Mantid/Framework/CurveFitting/test/DynamicKuboToyabeTest.h b/Code/Mantid/Framework/CurveFitting/test/DynamicKuboToyabeTest.h
index 74e8717d9fb958a023358c7834ef69926c86ead9..c3a78ecebf900dc31d7ac149254887cc0e358f18 100644
--- a/Code/Mantid/Framework/CurveFitting/test/DynamicKuboToyabeTest.h
+++ b/Code/Mantid/Framework/CurveFitting/test/DynamicKuboToyabeTest.h
@@ -79,7 +79,7 @@ public:
     TS_ASSERT_DELTA( y[4], 0.323394, 0.000001);
   }
 
-  void xtestZNDKTFunction()
+  void testZNDKTFunction()
   {
     // Test Dynamic Kubo Toyabe (DKT) for non-zero Field and Zero Nu (ZN)
     const double asym = 1.0;
@@ -107,7 +107,7 @@ public:
     TS_ASSERT_DELTA( y[4], 0.055052, 0.000001);
   }
 
-  void xtestDKTFunction()
+  void testDKTFunction()
   {
     // Test Dynamic Kubo Toyabe (DKT) (non-zero Field, non-zero Nu)
     const double asym = 1.0;
@@ -129,10 +129,10 @@ public:
     TS_ASSERT_THROWS_NOTHING(dkt.function(x,y));
 
     TS_ASSERT_DELTA( y[0], 1.000000, 0.000001);
-    TS_ASSERT_DELTA( y[1], 0.822498, 0.000001);
-    TS_ASSERT_DELTA( y[2], 0.518536, 0.000001);
-    TS_ASSERT_DELTA( y[3], 0.295988, 0.000001);
-    TS_ASSERT_DELTA( y[4], 0.175489, 0.000001);
+    TS_ASSERT_DELTA( y[1], 0.821663, 0.000001);
+    TS_ASSERT_DELTA( y[2], 0.518974, 0.000001);
+    TS_ASSERT_DELTA( y[3], 0.297548, 0.000001);
+    TS_ASSERT_DELTA( y[4], 0.177036, 0.000001);
   }
 
 
diff --git a/Code/Mantid/Framework/CurveFitting/test/FunctionFactoryConstraintTest.h b/Code/Mantid/Framework/CurveFitting/test/FunctionFactoryConstraintTest.h
index af5617975a9bbd3ab4f3da03571695fb070a6238..16b1c76cc47fcfeb36f6979a198dac6100d566f7 100644
--- a/Code/Mantid/Framework/CurveFitting/test/FunctionFactoryConstraintTest.h
+++ b/Code/Mantid/Framework/CurveFitting/test/FunctionFactoryConstraintTest.h
@@ -134,10 +134,10 @@ public:
 
 };
 
-DECLARE_FUNCTION(FunctionFactoryConstraintTest_FunctA);
-DECLARE_FUNCTION(FunctionFactoryConstraintTest_FunctB);
-DECLARE_FUNCTION(FunctionFactoryConstraintTest_CompFunctA);
-DECLARE_FUNCTION(FunctionFactoryConstraintTest_CompFunctB);
+DECLARE_FUNCTION(FunctionFactoryConstraintTest_FunctA)
+DECLARE_FUNCTION(FunctionFactoryConstraintTest_FunctB)
+DECLARE_FUNCTION(FunctionFactoryConstraintTest_CompFunctA)
+DECLARE_FUNCTION(FunctionFactoryConstraintTest_CompFunctB)
 
 class FunctionFactoryConstraintTest : public CxxTest::TestSuite
 {
diff --git a/Code/Mantid/Framework/CurveFitting/test/FunctionParameterDecoratorFitTest.h b/Code/Mantid/Framework/CurveFitting/test/FunctionParameterDecoratorFitTest.h
index 47cc259f355829cfec33c8e519944e3dd82abbe9..c7f60ebf936da427adc02bfe5a1b4a01c6b27288 100644
--- a/Code/Mantid/Framework/CurveFitting/test/FunctionParameterDecoratorFitTest.h
+++ b/Code/Mantid/Framework/CurveFitting/test/FunctionParameterDecoratorFitTest.h
@@ -46,7 +46,7 @@ public:
   }
 };
 
-DECLARE_FUNCTION(SimpleFunctionParameterDecorator);
+DECLARE_FUNCTION(SimpleFunctionParameterDecorator)
 
 class FunctionParameterDecoratorFitTest : public CxxTest::TestSuite {
 public:
@@ -70,7 +70,7 @@ public:
 
   void testFit() {
     Workspace2D_sptr ws =
-        WorkspaceCreationHelper::Create1DWorkspaceConstant(20, 1.5, 1.5);
+        WorkspaceCreationHelper::Create1DWorkspaceConstant(20, 1.5, 0.5);
 
     FunctionParameterDecorator_sptr fn =
         boost::make_shared<SimpleFunctionParameterDecorator>();
diff --git a/Code/Mantid/Framework/CurveFitting/test/GaussianTest.h b/Code/Mantid/Framework/CurveFitting/test/GaussianTest.h
index 40a9a43251b517d4b975720cd8f004cde88ac909..dcbddf65af1e2cb10d52d4691d55bf1ec149ebbb 100644
--- a/Code/Mantid/Framework/CurveFitting/test/GaussianTest.h
+++ b/Code/Mantid/Framework/CurveFitting/test/GaussianTest.h
@@ -51,7 +51,7 @@ protected:
   }
 };
 
-DECLARE_FUNCTION(SimplexGaussian);
+DECLARE_FUNCTION(SimplexGaussian)
 
 class GaussianTest : public CxxTest::TestSuite
 {
diff --git a/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h b/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..30b0ca92e8d438ed7550f85384bfff6bb6d7469c
--- /dev/null
+++ b/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h
@@ -0,0 +1,261 @@
+#ifndef MANTID_CURVEFITTING_PAWLEYFITTEST_H_
+#define MANTID_CURVEFITTING_PAWLEYFITTEST_H_
+
+#include <cxxtest/TestSuite.h>
+
+#include "MantidCurveFitting/PawleyFit.h"
+#include "MantidAPI/AlgorithmManager.h"
+#include "MantidAPI/FunctionFactory.h"
+#include "MantidAPI/TableRow.h"
+#include "MantidAPI/WorkspaceFactory.h"
+#include "MantidKernel/V3D.h"
+#include "MantidTestHelpers/WorkspaceCreationHelper.h"
+
+using Mantid::CurveFitting::PawleyFit;
+using namespace Mantid::API;
+using namespace Mantid::Kernel;
+
+class PawleyFitTest : public CxxTest::TestSuite {
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static PawleyFitTest *createSuite() { return new PawleyFitTest(); }
+  static void destroySuite(PawleyFitTest *suite) { delete suite; }
+
+  void testGetHKL() {
+    TestablePawleyFit pfit;
+
+    V3D referenceHKL(1, 2, 3);
+
+    TS_ASSERT_EQUALS(pfit.getHkl("1 2 3"), referenceHKL);
+    TS_ASSERT_EQUALS(pfit.getHkl(" 1 2 3 "), referenceHKL);
+    TS_ASSERT_EQUALS(pfit.getHkl("1 2 3"), referenceHKL);
+    TS_ASSERT_EQUALS(pfit.getHkl("1,2,3"), referenceHKL);
+    TS_ASSERT_EQUALS(pfit.getHkl("1;2;3"), referenceHKL);
+    TS_ASSERT_EQUALS(pfit.getHkl("[1,2,3]"), referenceHKL);
+    TS_ASSERT_EQUALS(pfit.getHkl("[1;2 3]"), referenceHKL);
+  }
+
+  void testFitHexagonalCellQ() {
+    /* Like in the PawleyFunctionTest, some reflections are needed.
+     * In this case, 5 reflections that belong to a hexagonal cell
+     * are used and stored in a TableWorkspace that has a suitable
+     * format for PawleyFit. The unit of the workspace is MomentumTransfer.
+     */
+
+    ITableWorkspace_sptr hkls = getHCPTable();
+    MatrixWorkspace_sptr ws =
+        getWorkspace(getFunctionString(hkls, true), (2.0 * M_PI) / 2.1,
+                     (2.0 * M_PI) / 1.0, 1000, "MomentumTransfer");
+
+    IAlgorithm_sptr pFit = AlgorithmManager::Instance().create("PawleyFit");
+    pFit->setProperty("InputWorkspace", ws);
+    pFit->setProperty("WorkspaceIndex", 0);
+    pFit->setProperty("CrystalSystem", "Hexagonal");
+    pFit->setProperty("InitialCell", "2.444 2.441 3.937 90 90 120");
+    pFit->setProperty("PeakTable", hkls);
+    pFit->setProperty("OutputWorkspace", "HCP_output");
+    pFit->setProperty("RefinedPeakParameterTable", "HCP_peaks");
+    pFit->setProperty("RefinedCellTable", "HCP_cell");
+
+    TS_ASSERT_THROWS_NOTHING(pFit->execute());
+
+    // Examine table with cell parameters.
+    ITableWorkspace_sptr cellWs =
+        AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("HCP_cell");
+
+    // Three rows (a, c, ZeroShift)
+    TS_ASSERT_EQUALS(cellWs->rowCount(), 3);
+
+    // Error of 'a' should be small
+    TS_ASSERT_LESS_THAN(fabs(cellWs->cell<double>(0, 2)), 1e-5);
+    // a should be almost equal to 2.45
+    TS_ASSERT_DELTA(cellWs->cell<double>(0, 1), 2.45, 1e-5);
+
+    // Error of 'c' should also be small
+    TS_ASSERT_LESS_THAN(fabs(cellWs->cell<double>(1, 2)), 1e-6);
+    // c should be almost equal to 3.93
+    TS_ASSERT_DELTA(cellWs->cell<double>(1, 1), 3.93, 1e-6);
+
+    // Check number of peak parameters.
+    ITableWorkspace_sptr peakWs =
+        AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+            "HCP_peaks");
+    TS_ASSERT_EQUALS(peakWs->rowCount(), 5 * 3); // 5 functions with 3 params.
+
+    AnalysisDataService::Instance().remove("HCP_output");
+    AnalysisDataService::Instance().remove("HCP_peaks");
+    AnalysisDataService::Instance().remove("HCP_cell");
+  }
+
+  void testFitOrthorhombicCelld() {
+    /* In analogy to the above example, an orthorhombic cell is fitted,
+     * this time in dSpacing and with a FlatBackground added.
+     */
+
+    ITableWorkspace_sptr hkls = getOrthorhombicTable();
+    MatrixWorkspace_sptr ws = getWorkspace(getFunctionString(hkls, false), 1.5,
+                                           2.1, 1000, "dSpacing");
+
+    IAlgorithm_sptr pFit = AlgorithmManager::Instance().create("PawleyFit");
+    pFit->setProperty("InputWorkspace", ws);
+    pFit->setProperty("WorkspaceIndex", 0);
+    pFit->setProperty("CrystalSystem", "Orthorhombic");
+    pFit->setProperty("InitialCell", "2.44 3.13 4.07 90 90 90");
+    pFit->setProperty("PeakTable", hkls);
+    pFit->setProperty("EnableChebyshevBackground", true);
+    pFit->setProperty("ChebyshevBackgroundDegree", 0);
+    pFit->setProperty("OutputWorkspace", "OP_output");
+    pFit->setProperty("RefinedPeakParameterTable", "OP_peaks");
+    pFit->setProperty("RefinedCellTable", "OP_cell");
+
+    pFit->execute();
+
+    // Examine table with cell parameters.
+    ITableWorkspace_sptr cellWs =
+        AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("OP_cell");
+
+    // Three rows (a, b, c, ZeroShift)
+    TS_ASSERT_EQUALS(cellWs->rowCount(), 4);
+
+    // Error of 'a' should be small
+    TS_ASSERT_LESS_THAN(fabs(cellWs->cell<double>(0, 2)), 1e-4);
+    // a should be almost equal to 2.45
+    TS_ASSERT_DELTA(cellWs->cell<double>(0, 1), 2.45, 2e-3);
+
+    // Error of 'b' should also be small
+    TS_ASSERT_LESS_THAN(fabs(cellWs->cell<double>(1, 2)), 1e-4);
+    // b should be almost equal to 3.12
+    TS_ASSERT_DELTA(cellWs->cell<double>(1, 1), 3.12, 2e-3);
+
+    // Error of 'c' should also be small
+    TS_ASSERT_LESS_THAN(fabs(cellWs->cell<double>(2, 2)), 1e-4);
+    // b should be almost equal to 4.06
+    TS_ASSERT_DELTA(cellWs->cell<double>(2, 1), 4.06, 2e-3);
+
+    // Check number of peak parameters.
+    ITableWorkspace_sptr peakWs =
+        AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("OP_peaks");
+    TS_ASSERT_EQUALS(peakWs->rowCount(), 7 * 3); // 5 functions with 3 params.
+
+    AnalysisDataService::Instance().remove("OP_output");
+    AnalysisDataService::Instance().remove("OP_peaks");
+    AnalysisDataService::Instance().remove("OP_cell");
+  }
+
+private:
+  class TestablePawleyFit : public PawleyFit {
+    friend class PawleyFitTest;
+
+  public:
+    TestablePawleyFit() : PawleyFit() {}
+    ~TestablePawleyFit() {}
+  };
+
+  ITableWorkspace_sptr getHCPTable() {
+    ITableWorkspace_sptr tableWs = WorkspaceFactory::Instance().createTable();
+    tableWs->addColumn("V3D", "HKL");
+    tableWs->addColumn("double", "d");
+    tableWs->addColumn("double", "FWHM (rel.)");
+    // Check that string columns are converted if they contain numbers
+    tableWs->addColumn("str", "Intensity");
+
+    TableRow row0 = tableWs->appendRow();
+    row0 << V3D(0, 0, 2) << 1.965 << 0.004 << "3800.0";
+
+    TableRow row1 = tableWs->appendRow();
+    row1 << V3D(1, 0, 1) << 1.867037 << 0.004 << "16400.0";
+    TableRow row2 = tableWs->appendRow();
+    row2 << V3D(1, 0, 2) << 1.441702 << 0.005 << "3700.0";
+    TableRow row3 = tableWs->appendRow();
+    row3 << V3D(1, 0, 3) << 1.114663 << 0.006 << "5900.0";
+    TableRow row4 = tableWs->appendRow();
+    row4 << V3D(2, -1, 0) << 1.225 << 0.004 << "5100.0";
+
+    return tableWs;
+  }
+
+  ITableWorkspace_sptr getOrthorhombicTable() {
+    ITableWorkspace_sptr tableWs = WorkspaceFactory::Instance().createTable();
+    tableWs->addColumn("V3D", "HKL");
+    tableWs->addColumn("double", "d");
+    tableWs->addColumn("double", "FWHM (rel.)");
+    // Check that string columns are converted if they contain numbers
+    tableWs->addColumn("str", "Intensity");
+
+    TableRow row0 = tableWs->appendRow();
+    row0 << V3D(0, 0, 2) << 2.03000 << 0.004 << "110.628118";
+
+    TableRow row1 = tableWs->appendRow();
+    row1 << V3D(0, 1, 2) << 1.701542 << 0.0042 << "180.646775";
+
+    TableRow row2 = tableWs->appendRow();
+    row2 << V3D(0, 2, 0) << 1.560000 << 0.00483 << "79.365613";
+
+    TableRow row3 = tableWs->appendRow();
+    row3 << V3D(1, 0, 1) << 2.097660 << 0.0041 << "228.086161";
+
+    TableRow row4 = tableWs->appendRow();
+    row4 << V3D(1, 0, 2) << 1.563144 << 0.004 << "159.249424";
+
+    TableRow row5 = tableWs->appendRow();
+    row5 << V3D(1, 1, 0) << 1.926908 << 0.004 << "209.913635";
+
+    TableRow row6 = tableWs->appendRow();
+    row6 << V3D(1, 1, 1) << 1.740797 << 0.00472 << "372.446264";
+
+    return tableWs;
+  }
+
+  std::string getFunctionString(const ITableWorkspace_sptr &table, bool useQ) {
+    std::vector<std::string> functionStrings;
+
+    for (size_t i = 0; i < table->rowCount(); ++i) {
+      TableRow row = table->getRow(i);
+      std::ostringstream fn;
+      double d = row.Double(1);
+      double center = useQ ? (2.0 * M_PI) / d : d;
+      double fwhmAbs = row.Double(2) * center;
+      fn << "name=Gaussian,PeakCentre=" << center
+         << ",Sigma=" << fwhmAbs / (2.0 * sqrt(2.0 * log(2.0)))
+         << ",Height=" << row.String(3);
+
+      functionStrings.push_back(fn.str());
+    }
+
+    return boost::join(functionStrings, ";");
+  }
+
+  MatrixWorkspace_sptr getWorkspace(const std::string &functionString,
+                                    double xMin, double xMax, size_t n,
+                                    const std::string &unit, double bg = 0.0) {
+    IFunction_sptr siFn =
+        FunctionFactory::Instance().createInitialized(functionString);
+
+    auto ws = WorkspaceFactory::Instance().create("Workspace2D", 1, n, n);
+
+    FunctionDomain1DVector xValues(xMin, xMax, n);
+    FunctionValues yValues(xValues);
+    std::vector<double> eValues(n, 1.0);
+
+    siFn->function(xValues, yValues);
+
+    std::vector<double> &xData = ws->dataX(0);
+    std::vector<double> &yData = ws->dataY(0);
+    std::vector<double> &eData = ws->dataE(0);
+
+    for (size_t i = 0; i < n; ++i) {
+      xData[i] = xValues[i];
+      yData[i] = yValues[i] + bg;
+      eData[i] = eValues[i];
+    }
+
+    WorkspaceCreationHelper::addNoise(ws, 0, -0.5, 0.5);
+
+    ws->getAxis(0)->setUnit(unit);
+
+    return ws;
+  }
+};
+
+#endif /* MANTID_CURVEFITTING_PAWLEYFITTEST_H_ */
diff --git a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..141f4d008e4764a8fdbb892a25f23da0b1f51422
--- /dev/null
+++ b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h
@@ -0,0 +1,523 @@
+#ifndef MANTID_CURVEFITTING_PAWLEYFUNCTIONTEST_H_
+#define MANTID_CURVEFITTING_PAWLEYFUNCTIONTEST_H_
+
+#include <cxxtest/TestSuite.h>
+
+#include "MantidCurveFitting/PawleyFunction.h"
+#include "MantidGeometry/Crystal/PointGroup.h"
+#include "MantidAPI/AlgorithmManager.h"
+#include "MantidAPI/FunctionFactory.h"
+#include "MantidAPI/WorkspaceFactory.h"
+#include "MantidTestHelpers/WorkspaceCreationHelper.h"
+
+using namespace Mantid::CurveFitting;
+using namespace Mantid::API;
+using namespace Mantid::Geometry;
+using namespace Mantid::Kernel;
+
+class PawleyFunctionTest : public CxxTest::TestSuite {
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static PawleyFunctionTest *createSuite() { return new PawleyFunctionTest(); }
+  static void destroySuite(PawleyFunctionTest *suite) { delete suite; }
+
+  void testCrystalSystem() {
+    PawleyParameterFunction fn;
+    fn.initialize();
+
+    TS_ASSERT(fn.hasAttribute("CrystalSystem"));
+
+    // Cubic, check case insensitivity
+    TS_ASSERT_THROWS_NOTHING(fn.setAttributeValue("CrystalSystem", "cubic"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Cubic);
+    TS_ASSERT_THROWS_NOTHING(fn.setAttributeValue("CrystalSystem", "Cubic"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Cubic);
+    TS_ASSERT_THROWS_NOTHING(fn.setAttributeValue("CrystalSystem", "CUBIC"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Cubic);
+
+    // Tetragonal
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "tetragonal"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Tetragonal);
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "Tetragonal"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Tetragonal);
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "TETRAGONAL"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Tetragonal);
+
+    // Hexagonal
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "hexagonal"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Hexagonal);
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "Hexagonal"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Hexagonal);
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "HEXAGONAL"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Hexagonal);
+
+    // Orthorhombic
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "orthorhombic"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Orthorhombic);
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "Orthorhombic"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Orthorhombic);
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "ORTHORHOMBIC"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Orthorhombic);
+
+    // Monoclinic
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "monoclinic"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Monoclinic);
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "Monoclinic"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Monoclinic);
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "MONOCLINIC"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Monoclinic);
+
+    // Triclinic
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "triclinic"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Triclinic);
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "Triclinic"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Triclinic);
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("CrystalSystem", "TRICLINIC"));
+    TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Triclinic);
+
+    // invalid string
+    TS_ASSERT_THROWS(fn.setAttributeValue("CrystalSystem", "invalid"),
+                     std::invalid_argument);
+  }
+
+  void testCrystalSystemConstraintsCubic() {
+    PawleyParameterFunction fn;
+    fn.initialize();
+
+    fn.setAttributeValue("CrystalSystem", "Cubic");
+
+    TS_ASSERT_EQUALS(fn.nParams(), 2);
+
+    fn.setParameter("a", 3.0);
+    TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0);
+
+    TS_ASSERT_THROWS(fn.getParameter("b"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("c"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Alpha"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Beta"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Gamma"), std::invalid_argument);
+
+    UnitCell cell = fn.getUnitCellFromParameters();
+    cellParametersAre(cell, 3.0, 3.0, 3.0, 90.0, 90.0, 90.0);
+  }
+
+  void testCrystalSystemConstraintsTetragonal() {
+    PawleyParameterFunction fn;
+    fn.initialize();
+
+    fn.setAttributeValue("CrystalSystem", "Tetragonal");
+
+    TS_ASSERT_EQUALS(fn.nParams(), 3);
+
+    fn.setParameter("a", 3.0);
+    TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0);
+    fn.setParameter("c", 5.0);
+    TS_ASSERT_EQUALS(fn.getParameter("c"), 5.0);
+
+    TS_ASSERT_THROWS(fn.getParameter("b"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Alpha"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Beta"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Gamma"), std::invalid_argument);
+
+    UnitCell cell = fn.getUnitCellFromParameters();
+    cellParametersAre(cell, 3.0, 3.0, 5.0, 90.0, 90.0, 90.0);
+  }
+
+  void testCrystalSystemConstraintsHexagonal() {
+    PawleyParameterFunction fn;
+    fn.initialize();
+
+    fn.setAttributeValue("CrystalSystem", "Hexagonal");
+
+    TS_ASSERT_EQUALS(fn.nParams(), 3);
+
+    fn.setParameter("a", 3.0);
+    TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0);
+    fn.setParameter("c", 5.0);
+    TS_ASSERT_EQUALS(fn.getParameter("c"), 5.0);
+
+    TS_ASSERT_THROWS(fn.getParameter("b"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Alpha"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Beta"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Gamma"), std::invalid_argument);
+
+    UnitCell cell = fn.getUnitCellFromParameters();
+    cellParametersAre(cell, 3.0, 3.0, 5.0, 90.0, 90.0, 120.0);
+  }
+
+  void testCrystalSystemConstraintsTrigonal() {
+    PawleyParameterFunction fn;
+    fn.initialize();
+
+    fn.setAttributeValue("CrystalSystem", "Trigonal");
+
+    TS_ASSERT_EQUALS(fn.nParams(), 3);
+
+    fn.setParameter("a", 3.0);
+    TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0);
+    fn.setParameter("Alpha", 101.0);
+    TS_ASSERT_EQUALS(fn.getParameter("Alpha"), 101.0);
+
+    TS_ASSERT_THROWS(fn.getParameter("b"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("c"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Beta"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Gamma"), std::invalid_argument);
+
+    UnitCell cell = fn.getUnitCellFromParameters();
+    cellParametersAre(cell, 3.0, 3.0, 3.0, 101.0, 101.0, 101.0);
+  }
+
+  void testCrystalSystemConstraintsOrthorhombic() {
+    PawleyParameterFunction fn;
+    fn.initialize();
+
+    fn.setAttributeValue("CrystalSystem", "Orthorhombic");
+
+    TS_ASSERT_EQUALS(fn.nParams(), 4);
+
+    fn.setParameter("a", 3.0);
+    TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0);
+    fn.setParameter("b", 4.0);
+    TS_ASSERT_EQUALS(fn.getParameter("b"), 4.0);
+    fn.setParameter("c", 5.0);
+    TS_ASSERT_EQUALS(fn.getParameter("c"), 5.0);
+
+    TS_ASSERT_THROWS(fn.getParameter("Alpha"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Beta"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Gamma"), std::invalid_argument);
+
+    UnitCell cell = fn.getUnitCellFromParameters();
+    cellParametersAre(cell, 3.0, 4.0, 5.0, 90.0, 90.0, 90.0);
+  }
+
+  void testCrystalSystemConstraintsMonoclinic() {
+    PawleyParameterFunction fn;
+    fn.initialize();
+
+    fn.setAttributeValue("CrystalSystem", "Monoclinic");
+
+    TS_ASSERT_EQUALS(fn.nParams(), 5);
+
+    fn.setParameter("a", 3.0);
+    TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0);
+    fn.setParameter("b", 4.0);
+    TS_ASSERT_EQUALS(fn.getParameter("b"), 4.0);
+    fn.setParameter("c", 5.0);
+    TS_ASSERT_EQUALS(fn.getParameter("c"), 5.0);
+    fn.setParameter("Beta", 101.0);
+    TS_ASSERT_EQUALS(fn.getParameter("Beta"), 101.0);
+
+    TS_ASSERT_THROWS(fn.getParameter("Alpha"), std::invalid_argument);
+    TS_ASSERT_THROWS(fn.getParameter("Gamma"), std::invalid_argument);
+
+    UnitCell cell = fn.getUnitCellFromParameters();
+    cellParametersAre(cell, 3.0, 4.0, 5.0, 90.0, 101.0, 90.0);
+  }
+
+  void testCrystalSystemConstraintsTriclinic() {
+    PawleyParameterFunction fn;
+    fn.initialize();
+
+    fn.setAttributeValue("CrystalSystem", "Triclinic");
+
+    TS_ASSERT_EQUALS(fn.nParams(), 7);
+
+    fn.setParameter("a", 3.0);
+    TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0);
+    fn.setParameter("b", 4.0);
+    TS_ASSERT_EQUALS(fn.getParameter("b"), 4.0);
+    fn.setParameter("c", 5.0);
+    TS_ASSERT_EQUALS(fn.getParameter("c"), 5.0);
+    fn.setParameter("Alpha", 101.0);
+    TS_ASSERT_EQUALS(fn.getParameter("Alpha"), 101.0);
+    fn.setParameter("Beta", 111.0);
+    TS_ASSERT_EQUALS(fn.getParameter("Beta"), 111.0);
+    fn.setParameter("Gamma", 103.0);
+    TS_ASSERT_EQUALS(fn.getParameter("Gamma"), 103.0);
+
+    UnitCell cell = fn.getUnitCellFromParameters();
+    cellParametersAre(cell, 3.0, 4.0, 5.0, 101.0, 111.0, 103.0);
+  }
+
+  void testSetParametersFromUnitCell() {
+    PawleyParameterFunction fn;
+    fn.initialize();
+
+    fn.setAttributeValue("CrystalSystem", "Triclinic");
+
+    UnitCell cell(3., 4., 5., 101., 111., 103.);
+
+    TS_ASSERT_THROWS_NOTHING(fn.setParametersFromUnitCell(cell));
+
+    TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0);
+    TS_ASSERT_EQUALS(fn.getParameter("b"), 4.0);
+    TS_ASSERT_EQUALS(fn.getParameter("c"), 5.0);
+    TS_ASSERT_EQUALS(fn.getParameter("Alpha"), 101.0);
+    TS_ASSERT_EQUALS(fn.getParameter("Beta"), 111.0);
+    TS_ASSERT_EQUALS(fn.getParameter("Gamma"), 103.0);
+
+    fn.setAttributeValue("CrystalSystem", "Cubic");
+
+    cell.seta(5.43);
+    TS_ASSERT_THROWS_NOTHING(fn.setParametersFromUnitCell(cell));
+
+    TS_ASSERT_EQUALS(fn.getParameter("a"), 5.43);
+  }
+
+  void testProfileFunctionName() {
+    PawleyParameterFunction fn;
+    fn.initialize();
+
+    TS_ASSERT_THROWS_NOTHING(
+        fn.setAttributeValue("ProfileFunction", "Gaussian"));
+    TS_ASSERT_EQUALS(fn.getProfileFunctionName(), "Gaussian");
+
+    // works only with IPeakFunctions
+    TS_ASSERT_THROWS(fn.setAttributeValue("ProfileFunction", "Chebyshev"),
+                     std::invalid_argument);
+
+    TS_ASSERT_THROWS(fn.setAttributeValue("ProfileFunction", "DoesNotExist"),
+                     Exception::NotFoundError);
+  }
+
+  void testPawleyFunctionInitialization() {
+    PawleyFunction fn;
+    fn.initialize();
+
+    TS_ASSERT(boost::dynamic_pointer_cast<CompositeFunction>(
+        fn.getDecoratedFunction()));
+
+    // The base parameters of PawleyParameterFunction
+    TS_ASSERT_EQUALS(fn.nParams(), 7);
+  }
+
+  void testPawleyFunctionSetCrystalSystem() {
+    PawleyFunction fn;
+    fn.initialize();
+
+    TS_ASSERT_EQUALS(fn.nParams(), 7);
+
+    fn.setCrystalSystem("Cubic");
+
+    TS_ASSERT_EQUALS(fn.nParams(), 2);
+  }
+
+  void testPawleyFunctionAddPeak() {
+    PawleyFunction fn;
+    fn.initialize();
+    TS_ASSERT_EQUALS(fn.getPeakCount(), 0);
+
+    TS_ASSERT_EQUALS(fn.nParams(), 7);
+
+    fn.addPeak(V3D(), 3.0, 4.0);
+
+    TS_ASSERT_EQUALS(fn.nParams(), 10);
+    TS_ASSERT_EQUALS(fn.getPeakCount(), 1);
+  }
+
+  void testPawleyFunctionClearPeaks() {
+    PawleyFunction fn;
+    fn.initialize();
+
+    fn.addPeak(V3D(), 3.0, 4.0);
+    TS_ASSERT_EQUALS(fn.getPeakCount(), 1);
+    TS_ASSERT_THROWS_NOTHING(fn.clearPeaks());
+    TS_ASSERT_EQUALS(fn.getPeakCount(), 0);
+  }
+
+  void testPawleyFunctionGetPeakHKL() {
+    PawleyFunction fn;
+    fn.initialize();
+
+    fn.addPeak(V3D(1, 1, 1), 3.0, 4.0);
+    TS_ASSERT_EQUALS(fn.getPeakCount(), 1);
+    TS_ASSERT_EQUALS(fn.getPeakHKL(0), V3D(1, 1, 1));
+  }
+
+  void testPawleyFunctionGetPeakFunction() {
+    PawleyFunction fn;
+    fn.initialize();
+
+    fn.addPeak(V3D(1, 1, 1), 3.0, 4.0);
+    TS_ASSERT_EQUALS(fn.getPeakCount(), 1);
+
+    IPeakFunction_sptr peak = fn.getPeakFunction(0);
+    TS_ASSERT(peak);
+    TS_ASSERT_EQUALS(peak->fwhm(), 3.0);
+    TS_ASSERT_EQUALS(peak->height(), 4.0);
+  }
+
+  void testPawleyFunctionSetProfileFunction() {
+    PawleyFunction fn;
+    fn.initialize();
+
+    TS_ASSERT_EQUALS(fn.nParams(), 7);
+
+    fn.addPeak(V3D(), 3.0, 4.0);
+
+    TS_ASSERT_EQUALS(fn.nParams(), 10);
+
+    fn.setProfileFunction("PseudoVoigt");
+
+    TS_ASSERT_EQUALS(fn.nParams(), 11);
+  }
+
+  void testPawleyFunctionGetParameterFunction() {
+    PawleyFunction fn;
+    fn.initialize();
+
+    TS_ASSERT(fn.getPawleyParameterFunction());
+  }
+
+  void testPawleyFunctionSetUnitCell() {
+    PawleyFunction fn;
+    fn.initialize();
+
+    TS_ASSERT_THROWS_NOTHING(fn.setUnitCell("1.0 2.0 3.0 90 91 92"));
+
+    PawleyParameterFunction_sptr parameters = fn.getPawleyParameterFunction();
+    TS_ASSERT_EQUALS(parameters->getParameter("a"), 1.0);
+    TS_ASSERT_EQUALS(parameters->getParameter("b"), 2.0);
+    TS_ASSERT_EQUALS(parameters->getParameter("c"), 3.0);
+    TS_ASSERT_EQUALS(parameters->getParameter("Alpha"), 90.0);
+    TS_ASSERT_EQUALS(parameters->getParameter("Beta"), 91.0);
+    TS_ASSERT_EQUALS(parameters->getParameter("Gamma"), 92.0);
+
+    TS_ASSERT_THROWS_NOTHING(fn.setUnitCell("2.0 3.0 4.0"));
+
+    TS_ASSERT_EQUALS(parameters->getParameter("a"), 2.0);
+    TS_ASSERT_EQUALS(parameters->getParameter("b"), 3.0);
+    TS_ASSERT_EQUALS(parameters->getParameter("c"), 4.0);
+    TS_ASSERT_EQUALS(parameters->getParameter("Alpha"), 90.0);
+    TS_ASSERT_EQUALS(parameters->getParameter("Beta"), 90.0);
+    TS_ASSERT_EQUALS(parameters->getParameter("Gamma"), 90.0);
+  }
+
+  void testFunctionFitSi() {
+    /* This example generates a spectrum with the first two reflections
+     * of Silicon with lattice parameter a = 5.4311946 Angstr.
+     *    hkl      d       height      fwhm
+     *   1 1 1  3.13570    40.0       0.006
+     *   2 2 0  1.92022    110.0      0.004
+     */
+    auto ws = getWorkspace(
+        "name=Gaussian,PeakCentre=3.13570166,Height=40.0,Sigma=0.003;name="
+        "Gaussian,PeakCentre=1.92021727,Height=110.0,Sigma=0.002",
+        1.85, 3.2, 400);
+
+    PawleyFunction_sptr pawleyFn = boost::make_shared<PawleyFunction>();
+    pawleyFn->initialize();
+    pawleyFn->setCrystalSystem("Cubic");
+    pawleyFn->addPeak(V3D(1, 1, 1), 0.0065, 35.0);
+    pawleyFn->addPeak(V3D(2, 2, 0), 0.0045, 110.0);
+    pawleyFn->setUnitCell("5.4295 5.4295 5.4295");
+
+    // fix ZeroShift
+    pawleyFn->fix(pawleyFn->parameterIndex("f0.ZeroShift"));
+
+    IAlgorithm_sptr fit = AlgorithmManager::Instance().create("Fit");
+    fit->setProperty("Function",
+                     boost::dynamic_pointer_cast<IFunction>(pawleyFn));
+    fit->setProperty("InputWorkspace", ws);
+    fit->execute();
+
+    PawleyParameterFunction_sptr parameters =
+        pawleyFn->getPawleyParameterFunction();
+
+    TS_ASSERT_DELTA(parameters->getParameter("a"), 5.4311946, 1e-6);
+  }
+
+  void testFunctionFitSiZeroShift() {
+    /* This example generates a spectrum with the first three reflections
+     * of Silicon with lattice parameter a = 5.4311946 Angstr.
+     *    hkl      d       height     ca. fwhm
+     *   1 1 1  3.13570    40.0       0.006
+     *   2 2 0  1.92022    110.0      0.004
+     *   3 1 1  1.63757    101.0      0.003
+     */
+    auto ws = getWorkspace(
+        "name=Gaussian,PeakCentre=3.13870166,Height=40.0,Sigma=0.003;name="
+        "Gaussian,PeakCentre=1.92321727,Height=110.0,Sigma=0.002;name=Gaussian,"
+        "PeakCentre=1.6405667,Height=105.0,Sigma=0.0016",
+        1.6, 3.2, 800);
+
+    PawleyFunction_sptr pawleyFn = boost::make_shared<PawleyFunction>();
+    pawleyFn->initialize();
+    pawleyFn->setCrystalSystem("Cubic");
+    pawleyFn->addPeak(V3D(1, 1, 1), 0.0065, 35.0);
+    pawleyFn->addPeak(V3D(2, 2, 0), 0.0045, 115.0);
+    pawleyFn->addPeak(V3D(3, 1, 1), 0.0035, 115.0);
+    pawleyFn->setUnitCell("5.433 5.433 5.433");
+    pawleyFn->setParameter("f0.ZeroShift", 0.001);
+
+    IAlgorithm_sptr fit = AlgorithmManager::Instance().create("Fit");
+    fit->setProperty("Function",
+                     boost::dynamic_pointer_cast<IFunction>(pawleyFn));
+    fit->setProperty("InputWorkspace", ws);
+    fit->execute();
+
+    PawleyParameterFunction_sptr parameters =
+        pawleyFn->getPawleyParameterFunction();
+
+    TS_ASSERT_DELTA(parameters->getParameter("a"), 5.4311946, 1e-5);
+    TS_ASSERT_DELTA(parameters->getParameter("ZeroShift"), 0.003, 1e-4);
+  }
+
+private:
+  MatrixWorkspace_sptr getWorkspace(const std::string &functionString,
+                                    double xMin, double xMax, size_t n) {
+    IFunction_sptr siFn =
+        FunctionFactory::Instance().createInitialized(functionString);
+
+    auto ws = WorkspaceFactory::Instance().create("Workspace2D", 1, n, n);
+
+    FunctionDomain1DVector xValues(xMin, xMax, n);
+    FunctionValues yValues(xValues);
+    std::vector<double> eValues(n, 1.0);
+
+    siFn->function(xValues, yValues);
+
+    std::vector<double> &xData = ws->dataX(0);
+    std::vector<double> &yData = ws->dataY(0);
+    std::vector<double> &eData = ws->dataE(0);
+
+    for (size_t i = 0; i < n; ++i) {
+      xData[i] = xValues[i];
+      yData[i] = yValues[i];
+      eData[i] = eValues[i];
+    }
+
+    WorkspaceCreationHelper::addNoise(ws, 0, -0.1, 0.1);
+
+    return ws;
+  }
+
+  void cellParametersAre(const UnitCell &cell, double a, double b, double c,
+                         double alpha, double beta, double gamma) {
+    TS_ASSERT_DELTA(cell.a(), a, 1e-9);
+    TS_ASSERT_DELTA(cell.b(), b, 1e-9);
+    TS_ASSERT_DELTA(cell.c(), c, 1e-9);
+
+    TS_ASSERT_DELTA(cell.alpha(), alpha, 1e-9);
+    TS_ASSERT_DELTA(cell.beta(), beta, 1e-9);
+    TS_ASSERT_DELTA(cell.gamma(), gamma, 1e-9);
+  }
+};
+
+#endif /* MANTID_CURVEFITTING_PAWLEYFUNCTIONTEST_H_ */
diff --git a/Code/Mantid/Framework/CurveFitting/test/ProductFunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/ProductFunctionTest.h
index 3232dc248cbc82932e3ed07c8c3c5065a61dcd1d..22833a6a4bf158d9044885bdd06438cca8207db2 100644
--- a/Code/Mantid/Framework/CurveFitting/test/ProductFunctionTest.h
+++ b/Code/Mantid/Framework/CurveFitting/test/ProductFunctionTest.h
@@ -121,8 +121,8 @@ public:
 
 };
 
-DECLARE_FUNCTION(ProductFunctionMWTest_Gauss);
-DECLARE_FUNCTION(ProductFunctionMWTest_Linear);
+DECLARE_FUNCTION(ProductFunctionMWTest_Gauss)
+DECLARE_FUNCTION(ProductFunctionMWTest_Linear)
 
 class ProductFunctionTest : public CxxTest::TestSuite
 {
diff --git a/Code/Mantid/Framework/CurveFitting/test/ResolutionTest.h b/Code/Mantid/Framework/CurveFitting/test/ResolutionTest.h
index ea03a3aa012327a415cd0723ccea367063ee515e..e4df7ce1a5caaa6594be10b9c6575a082f272bc3 100644
--- a/Code/Mantid/Framework/CurveFitting/test/ResolutionTest.h
+++ b/Code/Mantid/Framework/CurveFitting/test/ResolutionTest.h
@@ -99,7 +99,7 @@ public:
     }
 };
 
-DECLARE_FUNCTION(ResolutionTest_Gauss);
+DECLARE_FUNCTION(ResolutionTest_Gauss)
 
 class ResolutionTest : public CxxTest::TestSuite
 {
diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/ISISRunLogs.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/ISISRunLogs.h
index f1e2f3064e395a835a5490d48a72bca983f1e9bc..a939a0aa63dc00541a5fa73cae18ce5c690e6a93 100644
--- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/ISISRunLogs.h
+++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/ISISRunLogs.h
@@ -54,7 +54,7 @@ public:
   void addPeriodLogs(const int period, API::Run &exptRun);
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(ISISRunLogs);
+  DISABLE_DEFAULT_CONSTRUCT(ISISRunLogs)
 
   /// A LogParser object
   boost::scoped_ptr<Kernel::LogParser> m_logParser;
diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadISISNexus2.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadISISNexus2.h
index 144387c539a9e2da30873bee5def332ee4e08e96..d36c8c4739622875c8e999bdaec1fe98471089bc 100644
--- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadISISNexus2.h
+++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadISISNexus2.h
@@ -159,7 +159,8 @@ private:
                 Mantid::NeXus::NXEntry &entry);
   // Load a given period into the workspace
   void loadPeriodData(int64_t period, Mantid::NeXus::NXEntry &entry,
-                      DataObjects::Workspace2D_sptr &local_workspace);
+                      DataObjects::Workspace2D_sptr &local_workspace,
+                      bool update_spectra2det_mapping=false);
   // Load a data block
   void loadBlock(Mantid::NeXus::NXDataSetTyped<int> &data, int64_t blocksize,
                  int64_t period, int64_t start, int64_t &hist,
diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadSINQFocus.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadSINQFocus.h
index caa363519fdd502a4e9086b6030fef20c2983876..10e6588a8a0d6397c58326f5faaca7896b630cbc 100644
--- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadSINQFocus.h
+++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadSINQFocus.h
@@ -77,7 +77,6 @@ private:
   std::vector<std::string> m_supportedInstruments;
   std::string m_instrumentName;
   std::string m_instrumentPath;
-  ;
   API::MatrixWorkspace_sptr m_localWorkspace;
   size_t m_numberOfTubes;         // number of tubes - X
   size_t m_numberOfPixelsPerTube; // number of pixels per tube - Y
diff --git a/Code/Mantid/Framework/DataHandling/src/CreateChopperModel.cpp b/Code/Mantid/Framework/DataHandling/src/CreateChopperModel.cpp
index b3284c6ee7f134f89d6691611dd3bf7b2f5efca4..48274f1aa5f6cb83df567e3ac082d132a2b9a08d 100644
--- a/Code/Mantid/Framework/DataHandling/src/CreateChopperModel.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/CreateChopperModel.cpp
@@ -7,7 +7,7 @@
 namespace Mantid {
 namespace DataHandling {
 // Register the algorithm into the AlgorithmFactory
-DECLARE_ALGORITHM(CreateChopperModel);
+DECLARE_ALGORITHM(CreateChopperModel)
 
 using Kernel::Direction;
 using API::WorkspaceProperty;
@@ -21,10 +21,10 @@ using Kernel::MandatoryValidator;
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string CreateChopperModel::name() const {
   return "CreateChopperModel";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CreateChopperModel::version() const { return 1; };
+int CreateChopperModel::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CreateChopperModel::category() const {
diff --git a/Code/Mantid/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp b/Code/Mantid/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp
index d19f7f04c25ae52a1352913368899e0b478a630d..49ef716f071d41ff1d2f6e2e7f59f2814cfb4634 100644
--- a/Code/Mantid/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp
@@ -57,10 +57,10 @@ CreateChunkingFromInstrument::~CreateChunkingFromInstrument() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const string CreateChunkingFromInstrument::name() const {
   return "CreateChunkingFromInstrument";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CreateChunkingFromInstrument::version() const { return 1; };
+int CreateChunkingFromInstrument::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const string CreateChunkingFromInstrument::category() const {
diff --git a/Code/Mantid/Framework/DataHandling/src/CreateModeratorModel.cpp b/Code/Mantid/Framework/DataHandling/src/CreateModeratorModel.cpp
index a1f51bbddd71bdddd769112276e59dbb49c68262..d2008b1d47e5b5ed07d14a9153538feb51e8325b 100644
--- a/Code/Mantid/Framework/DataHandling/src/CreateModeratorModel.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/CreateModeratorModel.cpp
@@ -19,10 +19,10 @@ DECLARE_ALGORITHM(CreateModeratorModel)
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string CreateModeratorModel::name() const {
   return "CreateModeratorModel";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CreateModeratorModel::version() const { return 1; };
+int CreateModeratorModel::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CreateModeratorModel::category() const {
diff --git a/Code/Mantid/Framework/DataHandling/src/CreateSimulationWorkspace.cpp b/Code/Mantid/Framework/DataHandling/src/CreateSimulationWorkspace.cpp
index 3652a1d48ce00a2b86da4395e051fed90283be22..512b02efd72c4da9ddaca485502f26319f65a346 100644
--- a/Code/Mantid/Framework/DataHandling/src/CreateSimulationWorkspace.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/CreateSimulationWorkspace.cpp
@@ -19,7 +19,7 @@ namespace Mantid {
 namespace DataHandling {
 
 // Register the algorithm into the AlgorithmFactory
-DECLARE_ALGORITHM(CreateSimulationWorkspace);
+DECLARE_ALGORITHM(CreateSimulationWorkspace)
 
 using namespace API;
 
@@ -27,10 +27,10 @@ using namespace API;
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string CreateSimulationWorkspace::name() const {
   return "CreateSimulationWorkspace";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CreateSimulationWorkspace::version() const { return 1; };
+int CreateSimulationWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CreateSimulationWorkspace::category() const {
diff --git a/Code/Mantid/Framework/DataHandling/src/DeleteTableRows.cpp b/Code/Mantid/Framework/DataHandling/src/DeleteTableRows.cpp
index 84502532b0a1296f735499703d7f0b58b3f6e514..3a9b1c3bbb4c034c2bb6dff9d20d186847f51303 100644
--- a/Code/Mantid/Framework/DataHandling/src/DeleteTableRows.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/DeleteTableRows.cpp
@@ -13,7 +13,7 @@
 namespace Mantid {
 namespace DataHandling {
 // Register the algorithm into the algorithm factory
-DECLARE_ALGORITHM(DeleteTableRows);
+DECLARE_ALGORITHM(DeleteTableRows)
 
 using namespace Kernel;
 using namespace API;
diff --git a/Code/Mantid/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp b/Code/Mantid/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp
index ca9a49e80fee57370f31605bc292f4b96dfece88..3461ebea7d901c66b8f82f1bcf787994741e3235 100644
--- a/Code/Mantid/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp
@@ -15,10 +15,10 @@ ExtractMonitorWorkspace::~ExtractMonitorWorkspace() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string ExtractMonitorWorkspace::name() const {
   return "ExtractMonitorWorkspace";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ExtractMonitorWorkspace::version() const { return 1; };
+int ExtractMonitorWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ExtractMonitorWorkspace::category() const {
diff --git a/Code/Mantid/Framework/DataHandling/src/FindDetectorsPar.cpp b/Code/Mantid/Framework/DataHandling/src/FindDetectorsPar.cpp
index a0babedbc04b5f05580597ad4943add6a36f7a30..0a01cab4a09f1f9fdf716f31e76586986ea91fe4 100644
--- a/Code/Mantid/Framework/DataHandling/src/FindDetectorsPar.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/FindDetectorsPar.cpp
@@ -23,8 +23,8 @@ DECLARE_ALGORITHM(FindDetectorsPar)
 using namespace Kernel;
 using namespace API;
 // nothing here according to mantid
-FindDetectorsPar::FindDetectorsPar() : m_SizesAreLinear(false){};
-FindDetectorsPar::~FindDetectorsPar(){};
+FindDetectorsPar::FindDetectorsPar() : m_SizesAreLinear(false){}
+FindDetectorsPar::~FindDetectorsPar(){}
 
 void FindDetectorsPar::init() {
   auto wsValidator = boost::make_shared<CompositeValidator>();
diff --git a/Code/Mantid/Framework/DataHandling/src/ISISDataArchive.cpp b/Code/Mantid/Framework/DataHandling/src/ISISDataArchive.cpp
index df3faa501c68e359b2b64c085669c828c9bf5ea4..4e5f2d69d3f2470067cf3f65ccb48de9d4f37a9a 100644
--- a/Code/Mantid/Framework/DataHandling/src/ISISDataArchive.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/ISISDataArchive.cpp
@@ -21,7 +21,7 @@ namespace {
 Kernel::Logger g_log("ISISDataArchive");
 }
 
-DECLARE_ARCHIVESEARCH(ISISDataArchive, ISISDataSearch);
+DECLARE_ARCHIVESEARCH(ISISDataArchive, ISISDataSearch)
 
 namespace {
 #ifdef _WIN32
diff --git a/Code/Mantid/Framework/DataHandling/src/Load.cpp b/Code/Mantid/Framework/DataHandling/src/Load.cpp
index 9ca1b7ac270d7571d3e15a73e6e64352a4a0b345..cc23bd0ae14bec92e59e082e6d165985802265c9 100644
--- a/Code/Mantid/Framework/DataHandling/src/Load.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/Load.cpp
@@ -85,7 +85,7 @@ flattenVecOfVec(std::vector<std::vector<std::string>> vecOfVec) {
 namespace Mantid {
 namespace DataHandling {
 // Register the algorithm into the algorithm factory
-DECLARE_ALGORITHM(Load);
+DECLARE_ALGORITHM(Load)
 
 // The mutex
 Poco::Mutex Load::m_mutex;
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadAscii.cpp b/Code/Mantid/Framework/DataHandling/src/LoadAscii.cpp
index 6beb06f3fbfbdb0a81e14e93ef91e3235d1dc322..747bd5422b98555db8ceb6e6bff37a5245f66abe 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadAscii.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadAscii.cpp
@@ -18,7 +18,7 @@
 
 namespace Mantid {
 namespace DataHandling {
-DECLARE_FILELOADER_ALGORITHM(LoadAscii);
+DECLARE_FILELOADER_ALGORITHM(LoadAscii)
 
 using namespace Kernel;
 using namespace API;
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadAscii2.cpp b/Code/Mantid/Framework/DataHandling/src/LoadAscii2.cpp
index 37dc4a4e6436c5c696a87e04a93244f4c93cdfc9..3d603570fc4db2416cdf474ce3925954efeac76f 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadAscii2.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadAscii2.cpp
@@ -19,7 +19,7 @@
 
 namespace Mantid {
 namespace DataHandling {
-DECLARE_FILELOADER_ALGORITHM(LoadAscii2);
+DECLARE_FILELOADER_ALGORITHM(LoadAscii2)
 
 using namespace Kernel;
 using namespace API;
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadBBY.cpp b/Code/Mantid/Framework/DataHandling/src/LoadBBY.cpp
index 6794b27e1190685a1b6840878c5a60703c3da7c9..daddef4a35dc07e9151e09bdd0a0f243f0064e5d 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadBBY.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadBBY.cpp
@@ -14,7 +14,7 @@
 namespace Mantid {
 namespace DataHandling {
 // register the algorithm into the AlgorithmFactory
-DECLARE_FILELOADER_ALGORITHM(LoadBBY);
+DECLARE_FILELOADER_ALGORITHM(LoadBBY)
 
 // consts
 static const size_t HISTO_BINS_X = 240;
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D.cpp b/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D.cpp
index 1d07a5bb7525094b53b2215b695abc560cc4a5b5..b30663623408975b408f1ecd0b98185a1efe5872 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D.cpp
@@ -35,7 +35,7 @@ using namespace Mantid::DataObjects;
 namespace Mantid {
 namespace DataHandling {
 
-DECLARE_FILELOADER_ALGORITHM(LoadCanSAS1D);
+DECLARE_FILELOADER_ALGORITHM(LoadCanSAS1D)
 
 /// constructor
 LoadCanSAS1D::LoadCanSAS1D() : m_groupNumber(0) {}
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D2.cpp b/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D2.cpp
index 7dff9888a52e2ca1eb62666d6b7ef981ed1b8b72..378569dbbbb06142d61ab97386d7ff39eb5f1535 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D2.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D2.cpp
@@ -33,7 +33,7 @@ using namespace Mantid::DataObjects;
 namespace Mantid {
 namespace DataHandling {
 
-DECLARE_FILELOADER_ALGORITHM(LoadCanSAS1D2);
+DECLARE_FILELOADER_ALGORITHM(LoadCanSAS1D2)
 
 /// constructor
 LoadCanSAS1D2::LoadCanSAS1D2() : LoadCanSAS1D() {}
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadDaveGrp.cpp b/Code/Mantid/Framework/DataHandling/src/LoadDaveGrp.cpp
index 8ceabc67d96453729b3d49fbe7d28f351879c6d2..45ddef1b6dcfb71749e2649ed8207bacd7b6f61b 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadDaveGrp.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadDaveGrp.cpp
@@ -12,7 +12,7 @@
 
 namespace Mantid {
 namespace DataHandling {
-DECLARE_FILELOADER_ALGORITHM(LoadDaveGrp);
+DECLARE_FILELOADER_ALGORITHM(LoadDaveGrp)
 
 LoadDaveGrp::LoadDaveGrp() : ifile(), line(), nGroups(0), xLength(0) {}
 
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadEventPreNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadEventPreNexus.cpp
index d8d0ab699c667f3896bb82767d5941d303cc1df8..6fa76790f67189be3c17020ca1887e08b5a8f060 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadEventPreNexus.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadEventPreNexus.cpp
@@ -36,7 +36,7 @@
 namespace Mantid {
 namespace DataHandling {
 
-DECLARE_FILELOADER_ALGORITHM(LoadEventPreNexus);
+DECLARE_FILELOADER_ALGORITHM(LoadEventPreNexus)
 
 using namespace Kernel;
 using namespace API;
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadFITS.cpp b/Code/Mantid/Framework/DataHandling/src/LoadFITS.cpp
index 5d21f759abc30c40a8b8401cef8ff1b21774b5c5..c147984dc309b96d04e74125cca22c1dd1bf87b3 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadFITS.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadFITS.cpp
@@ -38,7 +38,7 @@ bool IsNotFits(std::string s) {
 namespace Mantid {
 namespace DataHandling {
 // Register the algorithm into the AlgorithmFactory
-DECLARE_FILELOADER_ALGORITHM(LoadFITS);
+DECLARE_FILELOADER_ALGORITHM(LoadFITS)
 
 /**
  * Constructor. Just initialize everything to prevent issues.
@@ -88,9 +88,11 @@ void LoadFITS::init() {
       "OutputWorkspace", "", Kernel::Direction::Output));
 
   declareProperty(
-      new PropertyWithValue<int>("ImageKey", -1, Kernel::Direction::Input),
+      new PropertyWithValue<int>("ImageKey", 0, Kernel::Direction::Input),
       "Image type to set these files as. 0=data image, 1=flat field, 2=open "
-      "field, -1=use the value from FITS header.");
+      "field, -1=use the value from FITS header. At present, if this is not "
+      "specified and an IMAGEKEY entry is not found in the FITS header, the "
+      "loader will show an error message and stop.");
 
   declareProperty(new PropertyWithValue<string>(BIT_DEPTH_NAME, "BITPIX",
                                                 Kernel::Direction::Input),
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadILL.cpp b/Code/Mantid/Framework/DataHandling/src/LoadILL.cpp
index 783927212fdd755e45003d4f900e5f9c6476570e..0f84c252a6f86a32fa9d6b811cc2a0ead98442ae 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadILL.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadILL.cpp
@@ -25,7 +25,7 @@ using namespace Kernel;
 using namespace API;
 using namespace NeXus;
 
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILL);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILL)
 
 //---------------------------------------------------
 // Private member functions
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadILLIndirect.cpp b/Code/Mantid/Framework/DataHandling/src/LoadILLIndirect.cpp
index 8309a686e68a6f556286e52688cb3cb71d9aa791..37e810ffae287c8bf3b17a2708fc86ed08c746de 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadILLIndirect.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadILLIndirect.cpp
@@ -18,7 +18,7 @@ using namespace API;
 using namespace NeXus;
 
 // Register the algorithm into the AlgorithmFactory
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILLIndirect);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILLIndirect)
 
 //----------------------------------------------------------------------------------------------
 /** Constructor
@@ -37,10 +37,10 @@ LoadILLIndirect::~LoadILLIndirect() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string LoadILLIndirect::name() const { return "LoadILLIndirect"; };
+const std::string LoadILLIndirect::name() const { return "LoadILLIndirect"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int LoadILLIndirect::version() const { return 1; };
+int LoadILLIndirect::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string LoadILLIndirect::category() const { return "DataHandling"; }
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadILLReflectometry.cpp b/Code/Mantid/Framework/DataHandling/src/LoadILLReflectometry.cpp
index 331795f61c3fe79a675b1563f68ea4b32ffb8160..739c5f9a6f6c5c4be0a09d7c26fbdb8fd658d810 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadILLReflectometry.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadILLReflectometry.cpp
@@ -23,7 +23,7 @@ using namespace API;
 using namespace NeXus;
 
 // Register the algorithm into the AlgorithmFactory
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILLReflectometry);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILLReflectometry)
 
 //----------------------------------------------------------------------------------------------
 /** Constructor
@@ -47,10 +47,10 @@ LoadILLReflectometry::~LoadILLReflectometry() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string LoadILLReflectometry::name() const {
   return "LoadILLReflectometry";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int LoadILLReflectometry::version() const { return 1; };
+int LoadILLReflectometry::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string LoadILLReflectometry::category() const {
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadILLSANS.cpp b/Code/Mantid/Framework/DataHandling/src/LoadILLSANS.cpp
index 6c3b96b5807bb7166dcf8636eb81754336c117f9..b29c361ef19f901b4182ec410740afc2bd51270a 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadILLSANS.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadILLSANS.cpp
@@ -30,10 +30,10 @@ LoadILLSANS::~LoadILLSANS() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string LoadILLSANS::name() const { return "LoadILLSANS"; };
+const std::string LoadILLSANS::name() const { return "LoadILLSANS"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int LoadILLSANS::version() const { return 1; };
+int LoadILLSANS::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string LoadILLSANS::category() const { return "DataHandling"; }
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp b/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp
index ca7d7a0dcf2b03cb260e4d541dec65f37bb800d2..fddfef1e1385a8439e317da6dff4302b0a858ae6 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp
@@ -9,7 +9,7 @@
 #include "MantidKernel/BoundedValidator.h"
 #include "MantidKernel/ConfigService.h"
 #include "MantidKernel/ListValidator.h"
-#include "MantidKernel/LogParser.h"
+//#include "MantidKernel/LogParser.h"
 #include "MantidKernel/LogFilter.h"
 #include "MantidKernel/TimeSeriesProperty.h"
 #include "MantidKernel/UnitFactory.h"
@@ -38,7 +38,7 @@
 
 namespace Mantid {
 namespace DataHandling {
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadISISNexus2);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadISISNexus2)
 
 using namespace Kernel;
 using namespace API;
@@ -232,8 +232,13 @@ void LoadISISNexus2::exec() {
   if (m_load_selected_spectra)
     m_spec2det_map = SpectrumDetectorMapping(spec(), udet(), udet.dim0());
   else
-    local_workspace->updateSpectraUsing(
+    if (bseparateMonitors) {
+      m_spec2det_map = SpectrumDetectorMapping(spec(), udet(), udet.dim0());
+      local_workspace->updateSpectraUsing(m_spec2det_map);
+    }else{
+      local_workspace->updateSpectraUsing(
         SpectrumDetectorMapping(spec(), udet(), udet.dim0()));
+    }
 
   if (!foundInstrument) {
     runLoadInstrument(local_workspace);
@@ -258,7 +263,7 @@ void LoadISISNexus2::exec() {
     m_tof_data.reset(new MantidVec(timeBins(), timeBins() + x_length));
   }
   int64_t firstentry = (m_entrynumber > 0) ? m_entrynumber : 1;
-  loadPeriodData(firstentry, entry, local_workspace);
+  loadPeriodData(firstentry, entry, local_workspace,m_load_selected_spectra);
 
   // Clone the workspace at this point to provide a base object for future
   // workspace generation.
@@ -284,7 +289,7 @@ void LoadISISNexus2::exec() {
       if (p > 1) {
         local_workspace = boost::dynamic_pointer_cast<DataObjects::Workspace2D>(
             WorkspaceFactory::Instance().create(period_free_workspace));
-        loadPeriodData(p, entry, local_workspace);
+        loadPeriodData(p, entry, local_workspace,m_load_selected_spectra);
         createPeriodLogs(p, local_workspace);
         // Check consistency of logs data for multi-period workspaces and raise
         // warnings where necessary.
@@ -345,7 +350,7 @@ void LoadISISNexus2::exec() {
         prepareSpectraBlocks(m_monitors, m_specInd2specNum_map, m_monBlockInfo);
 
         int64_t firstentry = (m_entrynumber > 0) ? m_entrynumber : 1;
-        loadPeriodData(firstentry, entry, monitor_workspace);
+        loadPeriodData(firstentry, entry, monitor_workspace,true);
 
         std::string monitorwsName = wsName + "_monitors";
         declareProperty(new WorkspaceProperty<Workspace>(
@@ -690,10 +695,13 @@ size_t LoadISISNexus2::prepareSpectraBlocks(
 * @param entry :: The opened root entry node for accessing the monitor and data
 * nodes
 * @param local_workspace :: The workspace to place the data in
+* @param update_spectra_det_map :: reset spectra-detector map to the one
+* calculated earlier. (Warning! -- this map has to be calculated correctly!)
 */
 void
 LoadISISNexus2::loadPeriodData(int64_t period, NXEntry &entry,
-                               DataObjects::Workspace2D_sptr &local_workspace) {
+                               DataObjects::Workspace2D_sptr &local_workspace,
+                               bool update_spectra2det_mapping) {
   int64_t hist_index = 0;
   int64_t period_index(period - 1);
   // int64_t first_monitor_spectrum = 0;
@@ -710,7 +718,7 @@ LoadISISNexus2::loadPeriodData(int64_t period, NXEntry &entry,
       MantidVec &E = local_workspace->dataE(hist_index);
       std::transform(Y.begin(), Y.end(), E.begin(), dblSqrt);
 
-      if (m_load_selected_spectra) {
+      if (update_spectra2det_mapping) {
         // local_workspace->getAxis(1)->setValue(hist_index,
         // static_cast<specid_t>(it->first));
         auto spec = local_workspace->getSpectrum(hist_index);
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadLLB.cpp b/Code/Mantid/Framework/DataHandling/src/LoadLLB.cpp
index b6fa8df3d966a372fa19105b3ac5be23ab3fc22f..ab280168840e54b2927a14a617903fb082e70f6b 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadLLB.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadLLB.cpp
@@ -18,7 +18,7 @@ using namespace Kernel;
 using namespace API;
 using namespace NeXus;
 
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadLLB);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadLLB)
 
 //----------------------------------------------------------------------------------------------
 /** Constructor
@@ -36,10 +36,10 @@ LoadLLB::~LoadLLB() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string LoadLLB::name() const { return "LoadLLB"; };
+const std::string LoadLLB::name() const { return "LoadLLB"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int LoadLLB::version() const { return 1; };
+int LoadLLB::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string LoadLLB::category() const { return "DataHandling"; }
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadMcStas.cpp b/Code/Mantid/Framework/DataHandling/src/LoadMcStas.cpp
index 027c60f08be6c6407a67e6500e53ee7846a15fe8..26c18005d8804a3aaa9ca2e9827f32ed5f407d01 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadMcStas.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadMcStas.cpp
@@ -24,7 +24,7 @@ using namespace API;
 using namespace DataObjects;
 
 // Register the algorithm into the AlgorithmFactory
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMcStas);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMcStas)
 
 //----------------------------------------------------------------------------------------------
 /** Constructor
@@ -38,10 +38,10 @@ LoadMcStas::~LoadMcStas() {}
 
 //----------------------------------------------------------------------------------------------
 // Algorithm's name for identification. @see Algorithm::name
-const std::string LoadMcStas::name() const { return "LoadMcStas"; };
+const std::string LoadMcStas::name() const { return "LoadMcStas"; }
 
 // Algorithm's version for identification. @see Algorithm::version
-int LoadMcStas::version() const { return 1; };
+int LoadMcStas::version() const { return 1; }
 
 // Algorithm's category for identification. @see Algorithm::category
 const std::string LoadMcStas::category() const { return "DataHandling"; }
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadMcStasNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadMcStasNexus.cpp
index ca5c88515d928b1c537a884f6a825e2336bab7f5..b9d6986d76df11859f2e33e73ec4d7494efd176e 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadMcStasNexus.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadMcStasNexus.cpp
@@ -15,7 +15,7 @@ namespace DataHandling {
 using namespace Kernel;
 using namespace API;
 
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMcStasNexus);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMcStasNexus)
 
 //----------------------------------------------------------------------------------------------
 /** Constructor
@@ -29,10 +29,10 @@ LoadMcStasNexus::~LoadMcStasNexus() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string LoadMcStasNexus::name() const { return "LoadMcStasNexus"; };
+const std::string LoadMcStasNexus::name() const { return "LoadMcStasNexus"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int LoadMcStasNexus::version() const { return 1; };
+int LoadMcStasNexus::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string LoadMcStasNexus::category() const { return "DataHandling"; }
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadMuonLog.cpp b/Code/Mantid/Framework/DataHandling/src/LoadMuonLog.cpp
index efcf09a27060b771c23abcb77184648573264f74..2cb1e7f47756176348b6fd98e5107b997e181eee 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadMuonLog.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadMuonLog.cpp
@@ -6,7 +6,7 @@
 #include "MantidKernel/TimeSeriesProperty.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidDataObjects/Workspace2D.h"
-#include "MantidKernel/LogParser.h"
+//#include "MantidKernel/LogParser.h"
 
 #include <ctime>
 
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus1.cpp b/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus1.cpp
index 7a71f4f24f5df76c8a8dfbd31f1d5eadc5ad1ffb..6f59be7278a4eb1fd693a87b332f46917f7f4928 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus1.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus1.cpp
@@ -30,7 +30,7 @@ namespace DataHandling {
 using namespace DataObjects;
 
 // Register the algorithm into the algorithm factory
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMuonNexus1);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMuonNexus1)
 
 using namespace Kernel;
 using namespace API;
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus2.cpp b/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus2.cpp
index d3876404a28394f0a79fc3a964d3ee0197813194..a885a97ada66770bf67dbc0881379dc97c852705 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus2.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus2.cpp
@@ -27,7 +27,7 @@
 namespace Mantid {
 namespace DataHandling {
 // Register the algorithm into the algorithm factory
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMuonNexus2);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMuonNexus2)
 
 using namespace Kernel;
 using namespace API;
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadNXSPE.cpp b/Code/Mantid/Framework/DataHandling/src/LoadNXSPE.cpp
index 5c5b4dc64163caa882dcd0a28b5588ce04f826f5..e9da8a302a8cd51cff2db16d893e394deaa811ab 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadNXSPE.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadNXSPE.cpp
@@ -22,7 +22,7 @@
 namespace Mantid {
 namespace DataHandling {
 
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadNXSPE);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadNXSPE)
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp b/Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp
index ebbde7d28c0d39da3eff9fc7892d63c914965f0b..a2c2054368e659b6331ef4d876899e07f280c1eb 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp
@@ -4,7 +4,7 @@
 #include "MantidDataHandling/LoadNexusLogs.h"
 #include <nexus/NeXusException.hpp>
 #include "MantidKernel/TimeSeriesProperty.h"
-#include "MantidKernel/LogParser.h"
+//#include "MantidKernel/LogParser.h"
 #include "MantidAPI/FileProperty.h"
 #include <cctype>
 
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp b/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp
index ffbfaac2167ddb04529f38f1f3adc817d96fd47e..21f97ef9eb2d0d4bc86556be5dc5fac2a3854825 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp
@@ -43,7 +43,7 @@ namespace Mantid {
 namespace DataHandling {
 
 // Register the algorithm into the algorithm factory
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadNexusProcessed);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadNexusProcessed)
 
 using namespace Mantid::NeXus;
 using namespace DataObjects;
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadPDFgetNFile.cpp b/Code/Mantid/Framework/DataHandling/src/LoadPDFgetNFile.cpp
index a0f89f59619488f5f3e3186367ac5c82da474eb8..108723a73f579972fed3aeb289ce79a5753dd7d4 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadPDFgetNFile.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadPDFgetNFile.cpp
@@ -25,7 +25,7 @@ using namespace boost;
 namespace Mantid {
 namespace DataHandling {
 
-DECLARE_FILELOADER_ALGORITHM(LoadPDFgetNFile);
+DECLARE_FILELOADER_ALGORITHM(LoadPDFgetNFile)
 
 //----------------------------------------------------------------------------------------------
 /** Constructor
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadPreNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadPreNexus.cpp
index 55090665c0930d3ac885075a750738830b38dfa2..4d076651853278122196019d7cbb5de86ae9240f 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadPreNexus.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadPreNexus.cpp
@@ -31,7 +31,7 @@ using std::vector;
 namespace Mantid {
 namespace DataHandling {
 
-DECLARE_FILELOADER_ALGORITHM(LoadPreNexus);
+DECLARE_FILELOADER_ALGORITHM(LoadPreNexus)
 
 static const string RUNINFO_PARAM("Filename");
 static const string MAP_PARAM("MappingFilename");
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadQKK.cpp b/Code/Mantid/Framework/DataHandling/src/LoadQKK.cpp
index cee4c47b1cd1dea67a6f5fd9594f977a03f9612c..859b592c087dcf441b7443d5963c1562b2e607eb 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadQKK.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadQKK.cpp
@@ -26,7 +26,7 @@ namespace Mantid {
 namespace DataHandling {
 
 // Register the algorithm into the AlgorithmFactory
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadQKK);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadQKK)
 
 /**
  * Return the confidence with with this algorithm can load the file
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp b/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp
index 453b4745c08fc3adfb78aff3e999ce7f0dc4b953..6ee8786c72d63f3509a54a30fa83296af7899a76 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp
@@ -24,7 +24,7 @@ namespace DataHandling {
 using namespace Mantid::API;
 using namespace Mantid::Kernel;
 
-DECLARE_FILELOADER_ALGORITHM(LoadRKH);
+DECLARE_FILELOADER_ALGORITHM(LoadRKH)
 
 /**
  * Return the confidence with with this algorithm can load the file
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadRaw3.cpp b/Code/Mantid/Framework/DataHandling/src/LoadRaw3.cpp
index 421add0dc04143d32b98b07b8237e4a230b200cc..9d95242111e22c35c71091919e346fafd473602f 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadRaw3.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadRaw3.cpp
@@ -24,7 +24,7 @@
 
 namespace Mantid {
 namespace DataHandling {
-DECLARE_FILELOADER_ALGORITHM(LoadRaw3);
+DECLARE_FILELOADER_ALGORITHM(LoadRaw3)
 
 using namespace Kernel;
 using namespace API;
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadRawHelper.cpp b/Code/Mantid/Framework/DataHandling/src/LoadRawHelper.cpp
index 7be90aaaf9eb15686295b9bdf3c5ae1dbf2aea5b..cd4c235958d145013d2f5b550cb8832fe327a62c 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadRawHelper.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadRawHelper.cpp
@@ -1197,13 +1197,15 @@ LoadRawHelper::searchForLogFiles(const std::string &pathToRawFile) {
 
       try {
         Kernel::Glob::glob(Poco::Path(dir).resolve(pattern), potentialLogFiles);
-        // push potential log files from set to list.
-        potentialLogFilesList.insert(potentialLogFilesList.begin(),
-                                     potentialLogFiles.begin(),
-                                     potentialLogFiles.end());
       } catch (std::exception &) {
       }
     }
+
+    // push potential log files from set to list.
+    potentialLogFilesList.insert(potentialLogFilesList.begin(),
+                                  potentialLogFiles.begin(),
+                                  potentialLogFiles.end());
+
     // Remove extension from path, and append .log to path.
     std::string logName =
         pathToRawFile.substr(0, pathToRawFile.rfind('.')) + ".log";
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadReflTBL.cpp b/Code/Mantid/Framework/DataHandling/src/LoadReflTBL.cpp
index bdbd87357b8329efe248b47f720674b8234587ed..31c713233a6be537bc695a59af78761ed44075fe 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadReflTBL.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadReflTBL.cpp
@@ -15,7 +15,7 @@
 
 namespace Mantid {
 namespace DataHandling {
-DECLARE_FILELOADER_ALGORITHM(LoadReflTBL);
+DECLARE_FILELOADER_ALGORITHM(LoadReflTBL)
 
 using namespace Kernel;
 using namespace API;
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSINQFocus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSINQFocus.cpp
index 482729016aae5107ef241005e219e519c729358f..c06cdf04b68cb7a759f28ce0a0b1715c163c50a7 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadSINQFocus.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadSINQFocus.cpp
@@ -18,7 +18,7 @@ using namespace Kernel;
 using namespace API;
 using namespace NeXus;
 
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadSINQFocus);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadSINQFocus)
 
 //----------------------------------------------------------------------------------------------
 /** Constructor
@@ -38,10 +38,10 @@ LoadSINQFocus::~LoadSINQFocus() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string LoadSINQFocus::name() const { return "LoadSINQFocus"; };
+const std::string LoadSINQFocus::name() const { return "LoadSINQFocus"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int LoadSINQFocus::version() const { return 1; };
+int LoadSINQFocus::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string LoadSINQFocus::category() const { return "DataHandling"; }
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSNSspec.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSNSspec.cpp
index a1c3ffd90e60f0da5cecb6d24462fcff7c2773e8..bbef0ccaf558350d2b7719dfe85b8670f73defa5 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadSNSspec.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadSNSspec.cpp
@@ -13,7 +13,7 @@
 
 namespace Mantid {
 namespace DataHandling {
-DECLARE_FILELOADER_ALGORITHM(LoadSNSspec);
+DECLARE_FILELOADER_ALGORITHM(LoadSNSspec)
 
 /**
  * Return the confidence with with this algorithm can load the file
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSPE.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSPE.cpp
index 25e3b4c72b7904abe9aa591beaebaa8af88ac3df..004b48b0a2b14b393b2d511b3f405a4d221ebf2f 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadSPE.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadSPE.cpp
@@ -18,7 +18,7 @@ namespace DataHandling {
 using namespace Kernel;
 using namespace API;
 
-DECLARE_FILELOADER_ALGORITHM(LoadSPE);
+DECLARE_FILELOADER_ALGORITHM(LoadSPE)
 
 /**
  * Return the confidence with with this algorithm can load the file
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSassena.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSassena.cpp
index e1f23f9bd4b95665aaf40e0e5793babd69ffbebe..2f749d8a0784a85acbf2d1bd419044ba6cf13a20 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadSassena.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadSassena.cpp
@@ -15,7 +15,7 @@
 namespace Mantid {
 namespace DataHandling {
 
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadSassena);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadSassena)
 
 /**
  * Return the confidence with with this algorithm can load the file
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSavuTomoConfig.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSavuTomoConfig.cpp
index 172ca4b47c5b4a373244e945e0630b1477410e2e..50184d1d4eabd559a6f52a27ec9367de916e7ce9 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadSavuTomoConfig.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadSavuTomoConfig.cpp
@@ -12,7 +12,7 @@ namespace Mantid {
 namespace DataHandling {
 
 // Register the algorithm into the algorithm factory
-DECLARE_ALGORITHM(LoadSavuTomoConfig);
+DECLARE_ALGORITHM(LoadSavuTomoConfig)
 
 using namespace Mantid::API;
 
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSpice2D.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSpice2D.cpp
index 1d8a877675e97446cd538081a4e6c5590e0980ce..49b271ef922119cdc8cc72c0aa813f1c0de1d7e0 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadSpice2D.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadSpice2D.cpp
@@ -36,7 +36,7 @@ using Poco::XML::Text;
 namespace Mantid {
 namespace DataHandling {
 // Register the algorithm into the AlgorithmFactory
-DECLARE_FILELOADER_ALGORITHM(LoadSpice2D);
+DECLARE_FILELOADER_ALGORITHM(LoadSpice2D)
 
 // Parse string and convert to numeric type
 template <class T>
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadTOFRawNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadTOFRawNexus.cpp
index 549ddc74278a518606f4cb0ebbc658b4458b78f8..d477812c6246b63b64ccbc44663244ff6fc77008 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadTOFRawNexus.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadTOFRawNexus.cpp
@@ -13,7 +13,7 @@
 namespace Mantid {
 namespace DataHandling {
 
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadTOFRawNexus);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadTOFRawNexus)
 
 using namespace Kernel;
 using namespace API;
diff --git a/Code/Mantid/Framework/DataHandling/src/NexusTester.cpp b/Code/Mantid/Framework/DataHandling/src/NexusTester.cpp
index 19657640086df1581cee9546912b6ff62935b102..2f1ed8f0471bad14b3da57c3519f3b60f07b7ef1 100644
--- a/Code/Mantid/Framework/DataHandling/src/NexusTester.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/NexusTester.cpp
@@ -30,10 +30,10 @@ NexusTester::~NexusTester() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string NexusTester::name() const { return "NexusTester"; };
+const std::string NexusTester::name() const { return "NexusTester"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int NexusTester::version() const { return 1; };
+int NexusTester::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string NexusTester::category() const {
diff --git a/Code/Mantid/Framework/DataHandling/src/PDLoadCharacterizations.cpp b/Code/Mantid/Framework/DataHandling/src/PDLoadCharacterizations.cpp
index 8e73ca0e825ca6bbaee6c6189b2d0e39c78def58..34b98ec08a15d88aba364ceb50b426f5ee4d9796 100644
--- a/Code/Mantid/Framework/DataHandling/src/PDLoadCharacterizations.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/PDLoadCharacterizations.cpp
@@ -36,10 +36,10 @@ PDLoadCharacterizations::~PDLoadCharacterizations() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string PDLoadCharacterizations::name() const {
   return "PDLoadCharacterizations";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int PDLoadCharacterizations::version() const { return 1; };
+int PDLoadCharacterizations::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string PDLoadCharacterizations::category() const {
diff --git a/Code/Mantid/Framework/DataHandling/src/SNSDataArchive.cpp b/Code/Mantid/Framework/DataHandling/src/SNSDataArchive.cpp
index 2ecc8bd1680a20f885d9b5069ae09a00ce6ea10e..ca088cab0faf7f1a46a733d9e0cc0f011b7f01b5 100644
--- a/Code/Mantid/Framework/DataHandling/src/SNSDataArchive.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/SNSDataArchive.cpp
@@ -32,7 +32,7 @@ const std::string
     BASE_URL("http://icat.sns.gov:2080/icat-rest-ws/datafile/filename/");
 }
 
-DECLARE_ARCHIVESEARCH(SNSDataArchive, SNSDataSearch);
+DECLARE_ARCHIVESEARCH(SNSDataArchive, SNSDataSearch)
 
 /**
  * @param filenames : List of files to search
diff --git a/Code/Mantid/Framework/DataHandling/src/SavePAR.cpp b/Code/Mantid/Framework/DataHandling/src/SavePAR.cpp
index 8d2ff9739bf65717d79b92706161be8b4b2ac64d..d318f94f549b5072121b412dc0b0a41673fd668e 100644
--- a/Code/Mantid/Framework/DataHandling/src/SavePAR.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/SavePAR.cpp
@@ -14,7 +14,7 @@ namespace Mantid {
 namespace DataHandling {
 
 // Register the algorithm into the AlgorithmFactory
-DECLARE_ALGORITHM(SavePAR);
+DECLARE_ALGORITHM(SavePAR)
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
diff --git a/Code/Mantid/Framework/DataHandling/src/SavePHX.cpp b/Code/Mantid/Framework/DataHandling/src/SavePHX.cpp
index ecb428de9af8c914a3d67370f576a163e171cc45..7c221896f8be4c88e1ae055a6dfd1bfad7bb027c 100644
--- a/Code/Mantid/Framework/DataHandling/src/SavePHX.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/SavePHX.cpp
@@ -14,7 +14,7 @@ namespace Mantid {
 namespace DataHandling {
 
 // Register the algorithm into the AlgorithmFactory
-DECLARE_ALGORITHM(SavePHX);
+DECLARE_ALGORITHM(SavePHX)
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
diff --git a/Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp b/Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp
index 9bee776e07f29f407e307f90680778acd8ca74fa..931538cbb9488116d9dcb0211b5061077e7df773 100644
--- a/Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp
@@ -36,10 +36,10 @@ SaveParameterFile::~SaveParameterFile() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string SaveParameterFile::name() const {
   return "SaveParameterFile";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int SaveParameterFile::version() const { return 1; };
+int SaveParameterFile::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string SaveParameterFile::category() const {
diff --git a/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp b/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp
index 772c8674974938d2aaa5fc8c68ebcb55f9ead60d..6b6878a8e8905a6483fac81e4740712a6629264c 100644
--- a/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp
@@ -25,12 +25,34 @@ DECLARE_ALGORITHM(SaveSPE)
 *  @throws std::runtime_error :: throws when there is a problem writing to disk,
 * usually disk space or permissions based
 */
+
+// use macro on platforms without variadic templates.
+#if defined(__INTEL_COMPILER) ||  ( defined(_MSC_VER) && _MSC_VER < 1800 )
+
 #define FPRINTF_WITH_EXCEPTION(stream, format, ...)                            \
   if (fprintf(stream, format, ##__VA_ARGS__) <= 0) {                           \
     throw std::runtime_error(                                                  \
         "Error writing to file. Check folder permissions and disk space.");    \
   }
 
+#else
+namespace {
+
+template <typename... vargs>
+void FPRINTF_WITH_EXCEPTION(FILE *stream, const char *format, vargs... args) {
+  if (fprintf(stream, format, args...) <= 0) {
+    throw std::runtime_error(
+        "Error writing to file. Check folder permissions and disk space.");
+  }
+}
+
+// special case needed for case with only two arguments.
+void FPRINTF_WITH_EXCEPTION(FILE *stream, const char *format) {
+  FPRINTF_WITH_EXCEPTION(stream, format, "");
+}
+}
+#endif
+
 using namespace Kernel;
 using namespace API;
 
diff --git a/Code/Mantid/Framework/DataHandling/src/SortTableWorkspace.cpp b/Code/Mantid/Framework/DataHandling/src/SortTableWorkspace.cpp
index 98b38f0fe8e429fd254b84090fbf81e155d44fab..6909250252c266fa1beccde46125ffdb2ff58c81 100644
--- a/Code/Mantid/Framework/DataHandling/src/SortTableWorkspace.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/SortTableWorkspace.cpp
@@ -24,7 +24,7 @@ SortTableWorkspace::~SortTableWorkspace() {}
 //----------------------------------------------------------------------------------------------
 
 /// Algorithm's version for identification. @see Algorithm::version
-int SortTableWorkspace::version() const { return 1; };
+int SortTableWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string SortTableWorkspace::category() const { return "Utility"; }
@@ -32,7 +32,7 @@ const std::string SortTableWorkspace::category() const { return "Utility"; }
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string SortTableWorkspace::summary() const {
   return "Sort a TableWorkspace.";
-};
+}
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Code/Mantid/Framework/DataHandling/test/LoadISISNexusTest.h b/Code/Mantid/Framework/DataHandling/test/LoadISISNexusTest.h
index 9335317a294e01f4ed22140c9937f645d32f9967..6c300c5785e0849c6931fff17419e315b69c4815 100644
--- a/Code/Mantid/Framework/DataHandling/test/LoadISISNexusTest.h
+++ b/Code/Mantid/Framework/DataHandling/test/LoadISISNexusTest.h
@@ -633,8 +633,40 @@ public:
     AnalysisDataService::Instance().remove("outWS");
   }
 
+  void xestExecMonExcludedInTheEnd()
+  {
+    Mantid::API::FrameworkManager::Instance();
+    LoadISISNexus2 ld;
+    ld.initialize();
+    ld.setPropertyValue("Filename","MAPS00018314.nxs");
+    ld.setPropertyValue("SpectrumMin","2");
+    ld.setPropertyValue("SpectrumMax","10");
+    ld.setPropertyValue("OutputWorkspace","outWS");
+    ld.setPropertyValue("LoadMonitors","Separate"); //
+    TS_ASSERT_THROWS_NOTHING(ld.execute());
+    TS_ASSERT(ld.isExecuted());
+
+
+    MatrixWorkspace_sptr ws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>("outWS");
+    TS_ASSERT_EQUALS(ws->blocksize(),2000);
+    TS_ASSERT_EQUALS(ws->getNumberHistograms(),9);
+
+    MatrixWorkspace_sptr ws_mon = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>("outWS_monitors");
+    TS_ASSERT(ws_mon)
+
+    TS_ASSERT_EQUALS(ws_mon->blocksize(),2000);
+    TS_ASSERT_EQUALS(ws_mon->getNumberHistograms(),4);
+    TS_ASSERT_DELTA(ws_mon->readX(0)[0],10,1.e-8);
+
+
+    TS_ASSERT_EQUALS(ws_mon->getSpectrum(0)->getSpectrumNo(),41473);
+    TS_ASSERT_EQUALS(ws_mon->getSpectrum(3)->getSpectrumNo(),41476);
 
 
+    AnalysisDataService::Instance().remove("outWS");
+    AnalysisDataService::Instance().remove("outWS_monitors");
+  }
+
 };
 
 //------------------------------------------------------------------------------
diff --git a/Code/Mantid/Framework/DataHandling/test/LoadRaw3Test.h b/Code/Mantid/Framework/DataHandling/test/LoadRaw3Test.h
index 77b4a90852d1f9f667907e332dc6acf449c3ad07..30aea2518a58723a9fa055aa22734f8b4750273f 100644
--- a/Code/Mantid/Framework/DataHandling/test/LoadRaw3Test.h
+++ b/Code/Mantid/Framework/DataHandling/test/LoadRaw3Test.h
@@ -115,6 +115,7 @@ public:
     // boost::shared_ptr<Sample> sample = output2D->getSample();
     Property *l_property = output2D->run().getLogData( std::string("TEMP1") );
     TimeSeriesProperty<double> *l_timeSeriesDouble = dynamic_cast<TimeSeriesProperty<double>*>(l_property);
+
     std::string timeSeriesString = l_timeSeriesDouble->value();
     TS_ASSERT_EQUALS( timeSeriesString.substr(0,23), "2007-Nov-13 15:16:20  0" );
 
diff --git a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/CoordTransformAligned.h b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/CoordTransformAligned.h
index 71973ec1c30a271bc7d96813475e5241f77c6a1f..59903ca16b65cfdacaad2b5e00c561264714e459 100644
--- a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/CoordTransformAligned.h
+++ b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/CoordTransformAligned.h
@@ -9,13 +9,13 @@ namespace Mantid {
 namespace DataObjects {
 
 /// Unique type declaration for which dimensions are used in the input workspace
-DECLARE_VECTOR_PARAMETER(DimensionsToBinFromParam, size_t);
+DECLARE_VECTOR_PARAMETER(DimensionsToBinFromParam, size_t)
 
 /// Unique type declaration for the offset of coordinates
-DECLARE_VECTOR_PARAMETER(OriginOffsetParam, coord_t);
+DECLARE_VECTOR_PARAMETER(OriginOffsetParam, coord_t)
 
 /// Unique type declaration for the step size in transformation
-DECLARE_VECTOR_PARAMETER(ScalingParam, coord_t);
+DECLARE_VECTOR_PARAMETER(ScalingParam, coord_t)
 
 /** A restricted version of CoordTransform which transforms
   from one set of dimensions to another, allowing:
diff --git a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/CoordTransformDistance.h b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/CoordTransformDistance.h
index d9cd5071680d7d5143bd7c0b33be96973c6db427..beec61ac08f3e4bc1421aff6cc0d12afd487632f 100644
--- a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/CoordTransformDistance.h
+++ b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/CoordTransformDistance.h
@@ -12,11 +12,11 @@ namespace Mantid {
 namespace DataObjects {
 /// Unique CoordCenterVectorParam type declaration for ndimensional coordinate
 /// centers
-DECLARE_VECTOR_PARAMETER(CoordCenterVectorParam, coord_t);
+DECLARE_VECTOR_PARAMETER(CoordCenterVectorParam, coord_t)
 
 /// Unique DimensionsUsedVectorParam type declaration for boolean masks over
 /// dimensions
-DECLARE_VECTOR_PARAMETER(DimensionsUsedVectorParam, bool);
+DECLARE_VECTOR_PARAMETER(DimensionsUsedVectorParam, bool)
 
 /** A non-linear coordinate transform that takes
  * a point from nd dimensions and converts it to a
diff --git a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/VectorColumn.h b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/VectorColumn.h
index 72c1e5031354f69b0d4b8a92d91acdff1f3e77b9..54952d823c76a4f5510ed1f61dd3237367f07970 100644
--- a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/VectorColumn.h
+++ b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/VectorColumn.h
@@ -171,7 +171,7 @@ private:
 #define DECLARE_VECTORCOLUMN(Type, TypeName)                                   \
   template <> std::string VectorColumn<Type>::typeName() {                     \
     return #TypeName;                                                          \
-  };                                                                           \
+  }                                                                            \
   Kernel::RegistrationHelper register_column_##TypeName((                      \
       API::ColumnFactory::Instance().subscribe<VectorColumn<Type>>(#TypeName), \
       0));
diff --git a/Code/Mantid/Framework/DataObjects/src/MDBox.cpp b/Code/Mantid/Framework/DataObjects/src/MDBox.cpp
index a7b2d20c7f00c6890b2e3e4173667fa5585190b6..efbc6f64817ab43682aadd0718b2dbddf5ce60ec 100644
--- a/Code/Mantid/Framework/DataObjects/src/MDBox.cpp
+++ b/Code/Mantid/Framework/DataObjects/src/MDBox.cpp
@@ -296,7 +296,7 @@ TMDE(void MDBox)::getEventsData(std::vector<coord_t> &coordTable,
 #ifdef MDBOX_TRACK_CENTROID
   this->calculateCentroid(this->m_centroid);
 #endif
-};
+}
 /** The method to convert the table of data into vector of events
  *   Used to load events from plain binary file
  *   @param coordTable -- vector of events parameters, which will be converted
@@ -305,7 +305,7 @@ TMDE(void MDBox)::getEventsData(std::vector<coord_t> &coordTable,
  */
 TMDE(void MDBox)::setEventsData(const std::vector<coord_t> &coordTable) {
   MDE::dataToEvents(coordTable, this->data);
-};
+}
 
 //-----------------------------------------------------------------------------------------------
 /** Allocate and return a vector with a copy of all events contained
diff --git a/Code/Mantid/Framework/DataObjects/src/PeakColumn.cpp b/Code/Mantid/Framework/DataObjects/src/PeakColumn.cpp
index b844cf39687756221a4f123a5f437883d64714d5..b3d7e129cc927636043721605c3517a80c4892a8 100644
--- a/Code/Mantid/Framework/DataObjects/src/PeakColumn.cpp
+++ b/Code/Mantid/Framework/DataObjects/src/PeakColumn.cpp
@@ -67,7 +67,7 @@ const std::string typeFromName(const std::string &name) {
         "\""
         "Peak column names/types must be explicitly marked in PeakColumn.cpp");
   }
-};
+}
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Code/Mantid/Framework/DataObjects/src/PeaksWorkspace.cpp b/Code/Mantid/Framework/DataObjects/src/PeaksWorkspace.cpp
index 4259cce7f869d452a9504fa74e32f7b87a851561..890e3e1e447ee7a078764edb120aceaedfc763d0 100644
--- a/Code/Mantid/Framework/DataObjects/src/PeaksWorkspace.cpp
+++ b/Code/Mantid/Framework/DataObjects/src/PeaksWorkspace.cpp
@@ -36,7 +36,7 @@ using namespace Mantid::Geometry;
 namespace Mantid {
 namespace DataObjects {
 /// Register the workspace as a type
-DECLARE_WORKSPACE(PeaksWorkspace);
+DECLARE_WORKSPACE(PeaksWorkspace)
 
 //---------------------------------------------------------------------------------------------
 /** Constructor. Create a table with all the required columns.
diff --git a/Code/Mantid/Framework/DataObjects/src/TableWorkspace.cpp b/Code/Mantid/Framework/DataObjects/src/TableWorkspace.cpp
index 138856ae152e5e5b9214c7c67379e19cbe1033d3..d2eac12677952e2456f05e6a57f03a5735562a3d 100644
--- a/Code/Mantid/Framework/DataObjects/src/TableWorkspace.cpp
+++ b/Code/Mantid/Framework/DataObjects/src/TableWorkspace.cpp
@@ -204,7 +204,7 @@ TableWorkspace *TableWorkspace::clone() const {
   // copy logs/properties.
   copy->m_LogManager = boost::make_shared<API::LogManager>(*this->m_LogManager);
   return copy;
-};
+}
 
 /**
  * Sort.
diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryElementFactory.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryElementFactory.cpp
index 40b6ba8c633af7940f6bea9f6aa494915b45385e..cdf42076ca548f067a1222773ab16a2499d99b68 100644
--- a/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryElementFactory.cpp
+++ b/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryElementFactory.cpp
@@ -425,11 +425,11 @@ void SymmetryElementFactoryImpl::insertPrototype(
   m_prototypes.insert(std::make_pair(identifier, prototype));
 }
 
-DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementIdentityGenerator);
-DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementTranslationGenerator);
-DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementInversionGenerator);
-DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementRotationGenerator);
-DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementMirrorGenerator);
+DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementIdentityGenerator)
+DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementTranslationGenerator)
+DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementInversionGenerator)
+DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementRotationGenerator)
+DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementMirrorGenerator)
 
 } // namespace Geometry
 } // namespace Mantid
diff --git a/Code/Mantid/Framework/ISISLiveData/src/FakeISISEventDAE.cpp b/Code/Mantid/Framework/ISISLiveData/src/FakeISISEventDAE.cpp
index 6d5a6fa75c92e107e1d93ce31776ece6adf035b2..c699dfb941193e5c54e70e3187967bd923ac0a01 100644
--- a/Code/Mantid/Framework/ISISLiveData/src/FakeISISEventDAE.cpp
+++ b/Code/Mantid/Framework/ISISLiveData/src/FakeISISEventDAE.cpp
@@ -19,7 +19,7 @@
 namespace Mantid {
 namespace ISISLiveData {
 // Register the algorithm into the algorithm factory
-DECLARE_ALGORITHM(FakeISISEventDAE);
+DECLARE_ALGORITHM(FakeISISEventDAE)
 
 using namespace Kernel;
 using namespace API;
diff --git a/Code/Mantid/Framework/Kernel/CMakeLists.txt b/Code/Mantid/Framework/Kernel/CMakeLists.txt
index 887bba0271579674dd2aff16e4107f268ffe51ac..07d6f10edbb7529ecaf9e15a95a7d554e653a20e 100644
--- a/Code/Mantid/Framework/Kernel/CMakeLists.txt
+++ b/Code/Mantid/Framework/Kernel/CMakeLists.txt
@@ -8,6 +8,7 @@ set ( SRC_FILES
 	src/CPUTimer.cpp
 	src/CatalogInfo.cpp
 	src/CompositeValidator.cpp
+	src/ComputeResourceInfo.cpp
 	src/ConfigService.cpp
 	src/ChecksumHelper.cpp
 	src/DataItem.cpp
@@ -128,6 +129,7 @@ set ( INC_FILES
 	inc/MantidKernel/Cache.h
 	inc/MantidKernel/CatalogInfo.h
 	inc/MantidKernel/CompositeValidator.h
+	inc/MantidKernel/ComputeResourceInfo.h
 	inc/MantidKernel/ConfigService.h
 	inc/MantidKernel/ChecksumHelper.h
 	inc/MantidKernel/DataItem.h
@@ -264,6 +266,7 @@ set ( TEST_FILES
 	CacheTest.h
 	CatalogInfoTest.h
 	CompositeValidatorTest.h
+	ComputeResourceInfoTest.h
 	ConfigServiceTest.h
 	ChecksumHelperTest.h
 	DataServiceTest.h
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ChecksumHelper.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ChecksumHelper.h
index 5a4f70794fe35eca19023c28a7ba59c495173de0..54a6b5fcf22e78c4d73b20cfa446924512861f84 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ChecksumHelper.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ChecksumHelper.h
@@ -40,7 +40,7 @@ MANTID_KERNEL_DLL std::string sha1FromString(const std::string &input);
 MANTID_KERNEL_DLL std::string sha1FromFile(const std::string &filepath);
 /// create a git checksum from a file (these match the git hash-object command)
 MANTID_KERNEL_DLL std::string gitSha1FromFile(const std::string &filepath);
-};
+}
 
 } // namespace Kernel
 } // namespace Mantid
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ComputeResourceInfo.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ComputeResourceInfo.h
new file mode 100644
index 0000000000000000000000000000000000000000..db27c93ed68e8bcaaf1e7434fc1dca88b3bd1483
--- /dev/null
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ComputeResourceInfo.h
@@ -0,0 +1,82 @@
+#ifndef MANTID_KERNEL_COMPUTERESOURCEINFO_H_
+#define MANTID_KERNEL_COMPUTERESOURCEINFO_H_
+
+#include <string>
+
+#include "MantidKernel/DllConfig.h"
+
+namespace Poco {
+namespace XML {
+class Element;
+}
+}
+
+namespace Mantid {
+namespace Kernel {
+
+class FacilityInfo;
+
+/**
+ComputeResourceInfo holds information about / represents a compute
+resource present in a facility.
+
+At the moment (remote) compute resources are defined by their name,
+the URL they can be accessed at, and the type of remote job manager
+that they use/require (Mantid web service API, LSF, etc.).
+
+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>.
+Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+class MANTID_KERNEL_DLL ComputeResourceInfo {
+public:
+  /// constructor - from facility info and the element for this resource
+  ComputeResourceInfo(const FacilityInfo *f, const Poco::XML::Element *elem);
+
+  /// Equality operator
+  bool operator==(const ComputeResourceInfo &rhs) const;
+
+  /// Name of the compute resource
+  std::string name() const;
+
+  /// Base URL the compute resource
+  std::string baseURL() const ;
+
+  /// Type/class of remote job manager required to handle this resource
+  std::string remoteJobManagerType() const;
+
+  /// The facility where this compute resource is avalable
+  const FacilityInfo &facility() const;
+
+private:
+  const FacilityInfo *m_facility; ///< Facility
+  std::string m_name;             ///< Cluster/resource name
+  std::string m_baseURL;          ///< access URL (first authentication, etc.)
+  std::string m_managerType;      ///< specific remote job manager class
+};
+
+/// output to stream operator for compute resource info objects
+MANTID_KERNEL_DLL std::ostream &
+operator<<(std::ostream &buffer, const  ComputeResourceInfo &cr);
+
+} // namespace Kernel
+} // namespace Mantid
+
+#endif /* MANTID_KERNEL_COMPUTERESOURCEINFO_H_ */
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/FacilityInfo.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/FacilityInfo.h
index 2d5976003305abfd697f2a52eb653a3accad0891..20c5d7172471f2ceb0367e185e410cbadf8a26f3 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/FacilityInfo.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/FacilityInfo.h
@@ -6,6 +6,7 @@
 //----------------------------------------------------------------------
 #include "MantidKernel/DllConfig.h"
 #include "MantidKernel/CatalogInfo.h"
+#include "MantidKernel/ComputeResourceInfo.h"
 #include "MantidKernel/InstrumentInfo.h"
 #include "MantidKernel/RemoteJobManager.h"
 #ifndef Q_MOC_RUN
@@ -80,7 +81,13 @@ public:
   std::vector<InstrumentInfo> instruments(const std::string &tech) const;
   /// Returns instruments with given name
   const InstrumentInfo &instrument(std::string iName = "") const;
-  /// Returns a vector of the available compute resources
+
+  /// Returns a vector of available compute resources
+  std::vector<ComputeResourceInfo> computeResInfos() const;
+  /// Returns a compute resource identified by name
+  const ComputeResourceInfo &computeResource(const std::string &name) const;
+
+  /// Returns a vector of the names of the available compute resources
   std::vector<std::string> computeResources() const;
   /// Returns the RemoteJobManager for the named compute resource
   boost::shared_ptr<RemoteJobManager>
@@ -113,12 +120,18 @@ private:
   std::vector<InstrumentInfo>
       m_instruments;          ///< list of instruments of this facility
   std::string m_liveListener; ///< name of the default live listener
+
+  std::vector<ComputeResourceInfo> m_computeResInfos; ///< (remote) compute
+  /// resources available in
+  /// this facility
+
+  // TODO: remove RemoteJobManager form here (trac ticket #11373)
   typedef std::map<std::string, boost::shared_ptr<RemoteJobManager>>
       ComputeResourcesMap;
   ComputeResourcesMap m_computeResources; ///< list of compute resources
                                           ///(clusters, etc...) available at
-  /// this facility
-  // (Sorted by their names)
+                                          /// this facility
+                                          // (Sorted by their names)
 };
 
 } // namespace Kernel
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/FileDescriptor.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/FileDescriptor.h
index bb5a73ee5e12545a400d890c7a5ae54bd245a535..ec76acae46bbbf443194dbfddf673ca0bf6dba40 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/FileDescriptor.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/FileDescriptor.h
@@ -78,8 +78,8 @@ public:
   void resetStreamToStart();
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(FileDescriptor);
-  DISABLE_COPY_AND_ASSIGN(FileDescriptor);
+  DISABLE_DEFAULT_CONSTRUCT(FileDescriptor)
+  DISABLE_COPY_AND_ASSIGN(FileDescriptor)
 
   /// Open the file and cache description elements
   void initialize(const std::string &filename);
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/FilteredTimeSeriesProperty.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/FilteredTimeSeriesProperty.h
index 74a31555811dca4fad720203c27cc37d3c13a397..6c4d23a45cabb514d3d0a1be448335ad9f62965b 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/FilteredTimeSeriesProperty.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/FilteredTimeSeriesProperty.h
@@ -49,7 +49,7 @@ public:
   const TimeSeriesProperty<HeldType> *unfiltered() const;
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(FilteredTimeSeriesProperty);
+  DISABLE_DEFAULT_CONSTRUCT(FilteredTimeSeriesProperty)
 
   /// The original unfiltered property as an owned pointer
   const TimeSeriesProperty<HeldType> *m_unfiltered;
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/LogFilter.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/LogFilter.h
index e9384a4ea1aa095cd2febd67f198b766fddde406..7f5b755c62191f5f4dac5a1c3b425b2b7dd63cd0 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/LogFilter.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/LogFilter.h
@@ -68,8 +68,8 @@ public:
   void clear();
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(LogFilter);
-  DISABLE_COPY_AND_ASSIGN(LogFilter);
+  DISABLE_DEFAULT_CONSTRUCT(LogFilter)
+  DISABLE_COPY_AND_ASSIGN(LogFilter)
 
   /// Converts the given property to a TimeSeriesProperty<double>, throws if
   /// invalid.
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MagneticFormFactorTable.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MagneticFormFactorTable.h
index 0e21199f3feddcc2e4b413f58ac1281f5663f466..00bd8c8e67bd386c601ce057e5039c2d4c269520 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MagneticFormFactorTable.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MagneticFormFactorTable.h
@@ -45,8 +45,8 @@ public:
   double value(const double qsqr) const;
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(MagneticFormFactorTable);
-  DISABLE_COPY_AND_ASSIGN(MagneticFormFactorTable);
+  DISABLE_DEFAULT_CONSTRUCT(MagneticFormFactorTable)
+  DISABLE_COPY_AND_ASSIGN(MagneticFormFactorTable)
 
   /// Setup the table with the values
   void setup(const MagneticIon &ion, const uint16_t j, const uint16_t l);
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/Math/Optimization/SLSQPMinimizer.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Math/Optimization/SLSQPMinimizer.h
index f536e4caebba98537b31216971a78afe79fcc9b2..193b623fcfc47c2c9441db272c47cac7889e7317 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/Math/Optimization/SLSQPMinimizer.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Math/Optimization/SLSQPMinimizer.h
@@ -106,8 +106,8 @@ public:
   std::vector<double> minimize(const std::vector<double> &x0) const;
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(SLSQPMinimizer);
-  DISABLE_COPY_AND_ASSIGN(SLSQPMinimizer);
+  DISABLE_DEFAULT_CONSTRUCT(SLSQPMinimizer)
+  DISABLE_COPY_AND_ASSIGN(SLSQPMinimizer)
 
   /**
    * Compute the value of the objective function
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MersenneTwister.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MersenneTwister.h
index 3b08e05e46c4a2a165f938ea058ae41786db42bb..5764a762678e9237d57737596836aef70c02042b 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MersenneTwister.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MersenneTwister.h
@@ -80,8 +80,8 @@ public:
   virtual void restore();
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(MersenneTwister);
-  DISABLE_COPY_AND_ASSIGN(MersenneTwister);
+  DISABLE_DEFAULT_CONSTRUCT(MersenneTwister)
+  DISABLE_COPY_AND_ASSIGN(MersenneTwister)
 
   /// The boost Mersenne Twister generator
   boost::mt19937 m_generator;
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDPseudoRandomNumberGenerator.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDPseudoRandomNumberGenerator.h
index b751348788955cbbf9c9e242488cb7b5684cc1f8..29066b78b3b7b8e20db114761c0010f09ed51f62 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDPseudoRandomNumberGenerator.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDPseudoRandomNumberGenerator.h
@@ -65,8 +65,8 @@ public:
   void restore();
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(NDPseudoRandomNumberGenerator);
-  DISABLE_COPY_AND_ASSIGN(NDPseudoRandomNumberGenerator);
+  DISABLE_DEFAULT_CONSTRUCT(NDPseudoRandomNumberGenerator)
+  DISABLE_COPY_AND_ASSIGN(NDPseudoRandomNumberGenerator)
 
   /// The single value generator
   SingleValueGenerator m_singleValueGen;
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDRandomNumberGenerator.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDRandomNumberGenerator.h
index 4d62f842c9507537e8a597dc542d95deac671c58..cbeae096e625fe1d1a77eab3df89487713dd4cc9 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDRandomNumberGenerator.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDRandomNumberGenerator.h
@@ -72,8 +72,8 @@ protected:
   inline std::vector<double> &getNextPointCache() { return m_nextPoint; }
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(NDRandomNumberGenerator);
-  DISABLE_COPY_AND_ASSIGN(NDRandomNumberGenerator);
+  DISABLE_DEFAULT_CONSTRUCT(NDRandomNumberGenerator)
+  DISABLE_COPY_AND_ASSIGN(NDRandomNumberGenerator)
 
   /// The number of dimensions
   const unsigned int m_ndims;
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h
index 5ae344033873922bad8c1083e9d9e53eb5d94ffe..f46774eebf53aea807b0107ba22d4e8e51cdeb7f 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h
@@ -98,8 +98,8 @@ public:
   bool classTypeExists(const std::string &classType) const;
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(NexusDescriptor);
-  DISABLE_COPY_AND_ASSIGN(NexusDescriptor);
+  DISABLE_DEFAULT_CONSTRUCT(NexusDescriptor)
+  DISABLE_COPY_AND_ASSIGN(NexusDescriptor)
 
   /// Initialize object with filename
   void initialize(const std::string &filename);
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h
index 85f67ac066da8f40144ae9bc5470bf9bd423c71e..bd55cf9b501cfb9a25f7b2a5365b562425a675fa 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h
@@ -198,10 +198,10 @@ void toValue(const std::string &strvalue, std::vector<std::vector<T>> &value,
     }                                                                          \
   }
 
-PROPERTYWITHVALUE_TOVALUE(int);
-PROPERTYWITHVALUE_TOVALUE(long);
-PROPERTYWITHVALUE_TOVALUE(uint32_t);
-PROPERTYWITHVALUE_TOVALUE(uint64_t);
+PROPERTYWITHVALUE_TOVALUE(int)
+PROPERTYWITHVALUE_TOVALUE(long)
+PROPERTYWITHVALUE_TOVALUE(uint32_t)
+PROPERTYWITHVALUE_TOVALUE(uint64_t)
 #if defined(__APPLE__)
 PROPERTYWITHVALUE_TOVALUE(unsigned long);
 #endif
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/PseudoRandomNumberGenerator.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/PseudoRandomNumberGenerator.h
index c6c1805f493815661e0d0b0cea4299d36cd5a015..06d1c067c571893d6af827a8b9db2fbdae3684c6 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/PseudoRandomNumberGenerator.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/PseudoRandomNumberGenerator.h
@@ -51,7 +51,7 @@ public:
   virtual void generateNextPoint();
 
 private:
-  DISABLE_COPY_AND_ASSIGN(PseudoRandomNumberGenerator);
+  DISABLE_COPY_AND_ASSIGN(PseudoRandomNumberGenerator)
 };
 }
 }
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/SobolSequence.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/SobolSequence.h
index 4d0be933d00fd7b5f3b847ac156c300ff95dc1a0..b45ed71c2deeb540e73ff280f736fbae1675e2f8 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/SobolSequence.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/SobolSequence.h
@@ -57,8 +57,8 @@ public:
   void restore();
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(SobolSequence);
-  DISABLE_COPY_AND_ASSIGN(SobolSequence);
+  DISABLE_DEFAULT_CONSTRUCT(SobolSequence)
+  DISABLE_COPY_AND_ASSIGN(SobolSequence)
 
   /// Set the number of dimensions
   void setNumberOfDimensions(const unsigned int ndims);
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/UnitLabel.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/UnitLabel.h
index 6cb1eb6cdc357bc652b0b1b21650f7fd65746ee0..0cd9829df37de1a85768d7f76f3e28775150af05 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/UnitLabel.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/UnitLabel.h
@@ -80,7 +80,7 @@ public:
   operator std::string() const;
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(UnitLabel);
+  DISABLE_DEFAULT_CONSTRUCT(UnitLabel)
 
   /// Value of plain-text label
   std::string m_ascii;
diff --git a/Code/Mantid/Framework/Kernel/src/ComputeResourceInfo.cpp b/Code/Mantid/Framework/Kernel/src/ComputeResourceInfo.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6669c1f228310ec4bcba078f3f79a072f96cad77
--- /dev/null
+++ b/Code/Mantid/Framework/Kernel/src/ComputeResourceInfo.cpp
@@ -0,0 +1,115 @@
+#include "MantidKernel/ComputeResourceInfo.h"
+#include "MantidKernel/FacilityInfo.h"
+#include "MantidKernel/Logger.h"
+
+#include <Poco/DOM/AutoPtr.h>
+#include <Poco/DOM/Element.h>
+#include <Poco/DOM/NodeList.h>
+#include <Poco/DOM/Text.h>
+
+namespace Mantid {
+namespace Kernel {
+namespace {
+// static logger object
+Logger g_log("ComputeResourceInfo");
+}
+
+/**
+ * Construct a compute resource from information found in a facilities
+ * definition file.
+ *
+ * @param fac Facility where this (remote) compute resource is available
+ * @param elem A (Poco::XML::) Element to read the data from
+ *
+ * @throw std::runtime_error if name or required attributes are not
+ * found
+ */
+ComputeResourceInfo::ComputeResourceInfo(const FacilityInfo *fac,
+                                         const Poco::XML::Element *elem)
+    : m_facility(fac) {
+
+  m_name = elem->getAttribute("name");
+  if (m_name.empty()) {
+    std::string elemStr = "";
+    if (elem)
+      elemStr = elem->innerText();
+    throw std::runtime_error(
+        "The compute resource name is not defined, at element: " + elemStr);
+  }
+
+  // default: Mantid web service API:
+  // http://www.mantidproject.org/Remote_Job_Submission_API
+  m_managerType = "MantidWebServiceAPIJobManager";
+  std::string type = elem->getAttribute("JobManagerType");
+  if (!type.empty()) {
+    m_managerType = type;
+  }
+
+  const std::string baseTag = "baseURL";
+  Poco::AutoPtr<Poco::XML::NodeList> nl = elem->getElementsByTagName(baseTag);
+  if (!nl || nl->length() != 1 || !nl->item(0) || !nl->item(0)->childNodes()) {
+    g_log.error("Failed to get base URL for remote compute resource '" +
+                m_name + "'");
+    throw std::runtime_error("Remote compute resources must have exactly one "
+                             "baseURL tag. It was not found for the resource "
+                             "'" +
+                             m_name + "'");
+  } else {
+    nl = nl->item(0)->childNodes();
+    if (nl->length() > 0) {
+      Poco::XML::Text *txt = dynamic_cast<Poco::XML::Text *>(nl->item(0));
+      if (txt) {
+        m_baseURL = txt->getData();
+      } else {
+        g_log.error("Failed to get base URL for remote compute resource '" +
+                    m_name + "'. The " + baseTag + " tag seems empty!");
+        throw std::runtime_error(
+            "Remote compute resources must have exactly one "
+            "baseURL tag containing a URL string. A tag was found for the "
+            "resource "
+            "'" +
+            m_name + "', but it seems empty!");
+      }
+    }
+  }
+}
+
+/**
+* Equality operator. Two different resources cannot have the same name
+*
+* @param rhs object to compare this with
+*
+* @return True if the objects (names) are equal
+*/
+bool ComputeResourceInfo::operator==(const ComputeResourceInfo &rhs) const {
+  return (this->name() == rhs.name());
+}
+
+std::string ComputeResourceInfo::name() const { return m_name; }
+
+std::string ComputeResourceInfo::baseURL() const { return m_baseURL; }
+
+std::string ComputeResourceInfo::remoteJobManagerType() const {
+  return m_managerType;
+}
+
+const FacilityInfo &ComputeResourceInfo::facility() const {
+  return *m_facility;
+}
+
+/**
+ * Prints the instrument name into an output stream
+ *
+ * @param buffer an output stream being written to
+ * @param cr a ComputeResourceInfo object to print
+ *
+ * @return reference to the output stream being written to
+ */
+std::ostream &operator<<(std::ostream &buffer, const ComputeResourceInfo &cr) {
+  buffer << "'" + cr.name() + "', at '" + cr.baseURL() + "', of type '" +
+                cr.remoteJobManagerType() + "'";
+  return buffer;
+}
+
+} // namespace Kernel
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/Kernel/src/FacilityInfo.cpp b/Code/Mantid/Framework/Kernel/src/FacilityInfo.cpp
index 7346c52307c62fe54291b6032c56f89309ff623a..dad72eec268239254af844eda8d20fd5d268cf1c 100644
--- a/Code/Mantid/Framework/Kernel/src/FacilityInfo.cpp
+++ b/Code/Mantid/Framework/Kernel/src/FacilityInfo.cpp
@@ -154,10 +154,24 @@ void FacilityInfo::fillComputeResources(const Poco::XML::Element *elem) {
   for (unsigned long i = 0; i < n; i++) {
     Poco::XML::Element *elem =
         dynamic_cast<Poco::XML::Element *>(pNL_compute->item(i));
-    std::string name = elem->getAttribute("name");
 
-    m_computeResources.insert(std::make_pair(
-        name, boost::shared_ptr<RemoteJobManager>(new RemoteJobManager(elem))));
+    if (elem) {
+      try {
+        ComputeResourceInfo cr(this, elem);
+        m_computeResInfos.push_back(cr);
+
+        g_log.debug() << "Compute resource found: " << cr << std::endl;
+      } catch (...) { // next resource...
+      }
+
+      std::string name = elem->getAttribute("name");
+      // TODO: this is a bit of duplicate effort at the moment, until
+      // RemoteJobManager goes away from here (then this would be
+      // removed), see header for details.
+      m_computeResources.insert(std::make_pair(
+          name,
+          boost::shared_ptr<RemoteJobManager>(new RemoteJobManager(elem))));
+    }
   }
 }
 
@@ -202,14 +216,22 @@ const InstrumentInfo &FacilityInfo::instrument(std::string iName) const {
 }
 
 /**
-  * Returns a list of instruments of given technique
-  * @param tech :: Technique name
-  * @return a list of instrument information objects
+  * Get the vector of available compute resources
+  * @return vector of ComputeResourInfo for the current facility
   */
+std::vector<ComputeResourceInfo> FacilityInfo::computeResInfos() const {
+  return m_computeResInfos;
+}
+
+/**
+* Returns a list of instruments of given technique
+* @param tech :: Technique name
+* @return a list of instrument information objects
+*/
 std::vector<InstrumentInfo>
 FacilityInfo::instruments(const std::string &tech) const {
   std::vector<InstrumentInfo> out;
-  std::vector<InstrumentInfo>::const_iterator it = m_instruments.begin();
+  auto it = m_instruments.begin();
   for (; it != m_instruments.end(); ++it) {
     if (it->techniques().count(tech)) {
       out.push_back(*it);
@@ -219,7 +241,7 @@ FacilityInfo::instruments(const std::string &tech) const {
 }
 
 /**
-  * Returns a vector of the available compute resources
+  * Returns a vector of the names of the available compute resources
   * @return vector of strings of the compute resource names
   */
 std::vector<std::string> FacilityInfo::computeResources() const {
@@ -233,6 +255,39 @@ std::vector<std::string> FacilityInfo::computeResources() const {
   return names;
 }
 
+/**
+ * Get a compute resource by name
+ *
+ * @param name Name as specified in the facilities definition file
+ *
+ * @return the named compute resource
+ *
+ * @throws NotFoundError if the resource is not found/available.
+ */
+const ComputeResourceInfo &
+FacilityInfo::computeResource(const std::string &name) const {
+  if (name.empty()) {
+    g_log.debug("Cannot find a compute resource without name "
+                "(empty).");
+    throw Exception::NotFoundError("FacilityInfo, empty compute resource name",
+                                   name);
+  }
+
+  auto it = m_computeResInfos.begin();
+  for (; it != m_computeResInfos.end(); ++it) {
+    if (it->name() == name) {
+      g_log.debug() << "Compute resource '" << name << "' found at facility "
+                    << this->name() << "." << std::endl;
+      return *it;
+    }
+  }
+
+  g_log.debug() << "Could not find requested compute resource: " << name
+                << " in facility " << this->name() << "." << std::endl;
+  throw Exception::NotFoundError("FacilityInfo, missing compute resource",
+                                 name);
+}
+
 /**
   * Returns a reference to the requested remote job manager
   * @param name :: Name of the cluster we want to submit jobs to
diff --git a/Code/Mantid/Framework/Kernel/src/FilteredTimeSeriesProperty.cpp b/Code/Mantid/Framework/Kernel/src/FilteredTimeSeriesProperty.cpp
index 07d01c24be0b4cf1b5bdaaac8e22b2c1032160e4..52a8e817ddbf20788717bb5f012aedc036f702a0 100644
--- a/Code/Mantid/Framework/Kernel/src/FilteredTimeSeriesProperty.cpp
+++ b/Code/Mantid/Framework/Kernel/src/FilteredTimeSeriesProperty.cpp
@@ -53,16 +53,16 @@ FilteredTimeSeriesProperty<HeldType>::unfiltered() const {
 
 // -------------------------- Concrete instantiation
 // -----------------------------------------------
-INSTANTIATE(int);
-INSTANTIATE(long);
-INSTANTIATE(long long);
-INSTANTIATE(unsigned int);
-INSTANTIATE(unsigned long);
-INSTANTIATE(unsigned long long);
-INSTANTIATE(float);
-INSTANTIATE(double);
-INSTANTIATE(std::string);
-INSTANTIATE(bool);
+INSTANTIATE(int)
+INSTANTIATE(long)
+INSTANTIATE(long long)
+INSTANTIATE(unsigned int)
+INSTANTIATE(unsigned long)
+INSTANTIATE(unsigned long long)
+INSTANTIATE(float)
+INSTANTIATE(double)
+INSTANTIATE(std::string)
+INSTANTIATE(bool)
 
 ///@endcond
 
diff --git a/Code/Mantid/Framework/Kernel/src/IPropertyManager.cpp b/Code/Mantid/Framework/Kernel/src/IPropertyManager.cpp
index 0d1730b581d78219392fb0204e49437f5bcdcfe4..36961d43915405e62d2d90412392bc68b81b579b 100644
--- a/Code/Mantid/Framework/Kernel/src/IPropertyManager.cpp
+++ b/Code/Mantid/Framework/Kernel/src/IPropertyManager.cpp
@@ -7,23 +7,23 @@
 #include <algorithm>
 
 ///@cond
-DEFINE_IPROPERTYMANAGER_GETVALUE(int16_t);
-DEFINE_IPROPERTYMANAGER_GETVALUE(uint16_t);
-DEFINE_IPROPERTYMANAGER_GETVALUE(int32_t);
-DEFINE_IPROPERTYMANAGER_GETVALUE(uint32_t);
-DEFINE_IPROPERTYMANAGER_GETVALUE(int64_t);
-DEFINE_IPROPERTYMANAGER_GETVALUE(uint64_t);
-DEFINE_IPROPERTYMANAGER_GETVALUE(bool);
-DEFINE_IPROPERTYMANAGER_GETVALUE(double);
-DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<int16_t>);
-DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<uint16_t>);
-DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<int32_t>);
-DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<uint32_t>);
-DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<int64_t>);
-DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<uint64_t>);
-DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<double>);
-DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<std::string>);
-DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<std::vector<std::string>>);
+DEFINE_IPROPERTYMANAGER_GETVALUE(int16_t)
+DEFINE_IPROPERTYMANAGER_GETVALUE(uint16_t)
+DEFINE_IPROPERTYMANAGER_GETVALUE(int32_t)
+DEFINE_IPROPERTYMANAGER_GETVALUE(uint32_t)
+DEFINE_IPROPERTYMANAGER_GETVALUE(int64_t)
+DEFINE_IPROPERTYMANAGER_GETVALUE(uint64_t)
+DEFINE_IPROPERTYMANAGER_GETVALUE(bool)
+DEFINE_IPROPERTYMANAGER_GETVALUE(double)
+DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<int16_t>)
+DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<uint16_t>)
+DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<int32_t>)
+DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<uint32_t>)
+DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<int64_t>)
+DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<uint64_t>)
+DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<double>)
+DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<std::string>)
+DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector<std::vector<std::string>>)
 
 namespace Mantid {
 namespace Kernel {
diff --git a/Code/Mantid/Framework/Kernel/src/InstrumentInfo.cpp b/Code/Mantid/Framework/Kernel/src/InstrumentInfo.cpp
index 60e610a0169609d84eb875d85918293bad4963b9..9b0f8bc57aced45671c461b6f8666ddd10a9832c 100644
--- a/Code/Mantid/Framework/Kernel/src/InstrumentInfo.cpp
+++ b/Code/Mantid/Framework/Kernel/src/InstrumentInfo.cpp
@@ -7,10 +7,10 @@
 #include "MantidKernel/Logger.h"
 #include "MantidKernel/Strings.h"
 
+#include <Poco/DOM/AutoPtr.h>
 #include <Poco/DOM/Element.h>
 #include <Poco/DOM/NodeList.h>
 #include <Poco/DOM/Text.h>
-#include <Poco/DOM/AutoPtr.h>
 
 #include <boost/lexical_cast.hpp>
 
diff --git a/Code/Mantid/Framework/Kernel/src/LogParser.cpp b/Code/Mantid/Framework/Kernel/src/LogParser.cpp
index c58b0d77155598a97376c45d293a07e36cc9faad..e88d7f883f308beaf3c98e47d179f04d5cf0e866 100644
--- a/Code/Mantid/Framework/Kernel/src/LogParser.cpp
+++ b/Code/Mantid/Framework/Kernel/src/LogParser.cpp
@@ -45,7 +45,7 @@ Kernel::Property *LogParser::createLogProperty(const std::string &logFName,
   }
 
   // Change times and new values read from file
-  std::map<std::string, std::string> change_times;
+  std::multimap<std::string, std::string> change_times;
 
   // Read in the data and determin if it is numeric
   std::string str, old_data;
@@ -70,8 +70,16 @@ Kernel::Property *LogParser::createLogProperty(const std::string &logFName,
         g_log.error(mess);
         throw std::logic_error(mess);
       }
-      change_times[stime] += std::string(" ") + str;
-      continue;
+      auto range = change_times.equal_range(stime);
+      if ( range.first != range.second ){
+        auto last = range.first;
+        for(auto it = last; it != range.second; ++it){
+          last = it;
+        }
+        last->second += std::string(" ") + str;
+        old_data = last->second;
+        continue;
+      }
     }
     stime = str.substr(0, 19);
     sdata = str.substr(19);
@@ -86,12 +94,7 @@ Kernel::Property *LogParser::createLogProperty(const std::string &logFName,
     isNumeric = !istr.fail();
     old_data = sdata;
 
-    // if time is repeated and the data aren't numeric append the new string to
-    // the old one
-    if (!isNumeric && change_times[stime].size() > 0)
-      change_times[stime] += std::string(" ") + sdata;
-    else
-      change_times[stime] = sdata;
+    change_times.insert( std::make_pair(stime,sdata) );
   }
 
   if (change_times.empty())
@@ -100,7 +103,7 @@ Kernel::Property *LogParser::createLogProperty(const std::string &logFName,
   if (isNumeric) {
     Kernel::TimeSeriesProperty<double> *logv =
         new Kernel::TimeSeriesProperty<double>(name);
-    std::map<std::string, std::string>::iterator it = change_times.begin();
+    auto it = change_times.begin();
     for (; it != change_times.end(); ++it) {
       std::istringstream istr(it->second);
       double d;
@@ -111,7 +114,7 @@ Kernel::Property *LogParser::createLogProperty(const std::string &logFName,
   } else {
     Kernel::TimeSeriesProperty<std::string> *logv =
         new Kernel::TimeSeriesProperty<std::string>(name);
-    std::map<std::string, std::string>::iterator it = change_times.begin();
+    auto it = change_times.begin();
     for (; it != change_times.end(); ++it) {
       logv->addValue(it->first, it->second);
     }
@@ -218,7 +221,7 @@ LogParser::LogParser(const Kernel::Property *log) : m_nOfPeriods(1) {
 
   m_nOfPeriods = 1;
 
-  std::map<Kernel::DateAndTime, std::string>::const_iterator it = logm.begin();
+  auto it = logm.begin();
 
   for (; it != logm.end(); ++it) {
     std::string scom;
@@ -253,7 +256,7 @@ Kernel::TimeSeriesProperty<bool> *LogParser::createPeriodLog(int period) const {
   Kernel::TimeSeriesProperty<bool> *p =
       new Kernel::TimeSeriesProperty<bool>("period " + ostr.str());
   std::map<Kernel::DateAndTime, int> pMap = periods->valueAsMap();
-  std::map<Kernel::DateAndTime, int>::const_iterator it = pMap.begin();
+  auto it = pMap.begin();
   if (it->second != period)
     p->addValue(it->first, false);
   for (; it != pMap.end(); ++it)
diff --git a/Code/Mantid/Framework/Kernel/src/Matrix.cpp b/Code/Mantid/Framework/Kernel/src/Matrix.cpp
index e6a50066fe5d10dbc4869ed96bb4b2dcc958b05b..425b07ab4f3d66e5371bf822f4ec65b6e729ff9c 100644
--- a/Code/Mantid/Framework/Kernel/src/Matrix.cpp
+++ b/Code/Mantid/Framework/Kernel/src/Matrix.cpp
@@ -351,11 +351,15 @@ V3D Matrix<T>::operator*(const V3D &Vx) const
   @return Matrix(This * A)
 */
 {
-  if (ny != 3 || nx != 3)
+  if (ny != 3 || nx > 3)
     throw Kernel::Exception::MisMatch<size_t>(ny, 3, "Matrix::operator*(V3D)");
-  return V3D(V[0][0] * Vx.X() + V[0][1] * Vx.Y() + V[0][2] * Vx.Z(),
-             V[1][0] * Vx.X() + V[1][1] * Vx.Y() + V[1][2] * Vx.Z(),
-             V[2][0] * Vx.X() + V[2][1] * Vx.Y() + V[2][2] * Vx.Z());
+
+  V3D v;
+  for(size_t i = 0; i < nx; ++i) {
+      v[i] = V[i][0] * Vx.X() + V[i][1] * Vx.Y() + V[i][2] * Vx.Z();
+  }
+
+  return v;
 }
 
 template <typename T>
diff --git a/Code/Mantid/Framework/Kernel/src/MatrixProperty.cpp b/Code/Mantid/Framework/Kernel/src/MatrixProperty.cpp
index 3ff63a07bf748f1a15397d4b1add81652b56a9c2..ddd680bdac9ea217da6fab7c7c783134e2d069ef 100644
--- a/Code/Mantid/Framework/Kernel/src/MatrixProperty.cpp
+++ b/Code/Mantid/Framework/Kernel/src/MatrixProperty.cpp
@@ -43,7 +43,7 @@ template class MANTID_KERNEL_DLL MatrixProperty<float>;
 /**
  * IPropertyManager::getValue definitions
  */
-DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::DblMatrix);
-DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::IntMatrix);
-DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::Matrix<float>);
+DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::DblMatrix)
+DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::IntMatrix)
+DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::Matrix<float>)
 ///@endcond
diff --git a/Code/Mantid/Framework/Kernel/src/PropertyWithValue.cpp b/Code/Mantid/Framework/Kernel/src/PropertyWithValue.cpp
index e087f25a23fc04c8bfb66fd04dbf795c27b0b703..038a26cc359abd12083be4e8546b336ab48bf427 100644
--- a/Code/Mantid/Framework/Kernel/src/PropertyWithValue.cpp
+++ b/Code/Mantid/Framework/Kernel/src/PropertyWithValue.cpp
@@ -10,16 +10,16 @@ namespace Kernel {
   template DLLExport class PropertyWithValue<std::vector<Type>>;
 
 // Explicit instantiations
-INSTANTIATE(int);
-INSTANTIATE(long);
-INSTANTIATE(long long);
-INSTANTIATE(unsigned short int);
-INSTANTIATE(unsigned int);
-INSTANTIATE(unsigned long);
-INSTANTIATE(unsigned long long);
-INSTANTIATE(bool);
-INSTANTIATE(double);
-INSTANTIATE(std::string);
+INSTANTIATE(int)
+INSTANTIATE(long)
+INSTANTIATE(long long)
+INSTANTIATE(unsigned short int)
+INSTANTIATE(unsigned int)
+INSTANTIATE(unsigned long)
+INSTANTIATE(unsigned long long)
+INSTANTIATE(bool)
+INSTANTIATE(double)
+INSTANTIATE(std::string)
 /// @endcond
 
 } // namespace Kernel
diff --git a/Code/Mantid/Framework/Kernel/src/Statistics.cpp b/Code/Mantid/Framework/Kernel/src/Statistics.cpp
index 9af3f0335c5d2e0436d1ee3694dd5fbe7a2e412a..6a021e757806d99a549b69131b44c37009466422 100644
--- a/Code/Mantid/Framework/Kernel/src/Statistics.cpp
+++ b/Code/Mantid/Framework/Kernel/src/Statistics.cpp
@@ -405,14 +405,14 @@ std::vector<double> getMomentsAboutMean(const std::vector<TYPE> &x,
 
 // --------------------------- Concrete instantiations
 // ---------------------------------------------
-INSTANTIATE(float);
-INSTANTIATE(double);
-INSTANTIATE(int);
-INSTANTIATE(long);
-INSTANTIATE(long long);
-INSTANTIATE(unsigned int);
-INSTANTIATE(unsigned long);
-INSTANTIATE(unsigned long long);
+INSTANTIATE(float)
+INSTANTIATE(double)
+INSTANTIATE(int)
+INSTANTIATE(long)
+INSTANTIATE(long long)
+INSTANTIATE(unsigned int)
+INSTANTIATE(unsigned long)
+INSTANTIATE(unsigned long long)
 
 } // namespace Kernel
 } // namespace Mantid
diff --git a/Code/Mantid/Framework/Kernel/src/TimeSeriesProperty.cpp b/Code/Mantid/Framework/Kernel/src/TimeSeriesProperty.cpp
index e129b7010c2853e88c459f3db86c216a68bb4519..c6057895d5fdfca2f4ac6aaac52b913364003493 100644
--- a/Code/Mantid/Framework/Kernel/src/TimeSeriesProperty.cpp
+++ b/Code/Mantid/Framework/Kernel/src/TimeSeriesProperty.cpp
@@ -2026,16 +2026,16 @@ TimeSeriesProperty<TYPE>::setValueFromProperty(const Property &right) {
 
 // -------------------------- Concrete instantiation
 // -----------------------------------------------
-INSTANTIATE(int);
-INSTANTIATE(long);
-INSTANTIATE(long long);
-INSTANTIATE(unsigned int);
-INSTANTIATE(unsigned long);
-INSTANTIATE(unsigned long long);
-INSTANTIATE(float);
-INSTANTIATE(double);
-INSTANTIATE(std::string);
-INSTANTIATE(bool);
+INSTANTIATE(int)
+INSTANTIATE(long)
+INSTANTIATE(long long)
+INSTANTIATE(unsigned int)
+INSTANTIATE(unsigned long)
+INSTANTIATE(unsigned long long)
+INSTANTIATE(float)
+INSTANTIATE(double)
+INSTANTIATE(std::string)
+INSTANTIATE(bool)
 
 /// @endcond
 
diff --git a/Code/Mantid/Framework/Kernel/src/Unit.cpp b/Code/Mantid/Framework/Kernel/src/Unit.cpp
index 82e3541bc80de599ae9ec455ff2105f9c17faf2f..8495405f2101f53e4c70c3ac2b7bc88348d3c81a 100644
--- a/Code/Mantid/Framework/Kernel/src/Unit.cpp
+++ b/Code/Mantid/Framework/Kernel/src/Unit.cpp
@@ -1108,10 +1108,10 @@ double Time::singleFromTOF(const double tof) const {
 
 double Time::conversionTOFMax() const {
   return std::numeric_limits<double>::quiet_NaN();
-};
+}
 double Time::conversionTOFMin() const {
   return std::numeric_limits<double>::quiet_NaN();
-};
+}
 
 Unit *Time::clone() const { return new Time(*this); }
 
diff --git a/Code/Mantid/Framework/Kernel/test/ComputeResourceInfoTest.h b/Code/Mantid/Framework/Kernel/test/ComputeResourceInfoTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..213a98ed2098662b0748101000aaaa992a0a8cc0
--- /dev/null
+++ b/Code/Mantid/Framework/Kernel/test/ComputeResourceInfoTest.h
@@ -0,0 +1,269 @@
+#ifndef COMPUTERESOURCEINFOTEST_H_
+#define COMPUTERESOURCEINFOTEST_H_
+
+#include "MantidKernel/Exception.h"
+#include "MantidKernel/FacilityInfo.h"
+
+#include <Poco/DOM/AutoPtr.h>
+#include <Poco/DOM/Document.h>
+#include <Poco/DOM/DOMParser.h>
+#include <Poco/XML/XMLException.h>
+
+using namespace Mantid::Kernel;
+
+class ComputeResourceInfoTest : public CxxTest::TestSuite {
+public:
+  void test_allMissing() {
+    FacilityInfo *fac = NULL;
+    TS_ASSERT_THROWS_NOTHING(fac =
+                                 createCRInfoInMinimalFacility(simpleInstStr));
+    TS_ASSERT(fac);
+    std::vector<ComputeResourceInfo> cri;
+    TS_ASSERT_THROWS_NOTHING(cri = fac->computeResInfos());
+    TS_ASSERT_EQUALS(cri.size(), 0);
+
+    delete fac;
+    fac = NULL;
+    TS_ASSERT_THROWS(fac = createCRInfoInMinimalFacility(
+                         "<computeResource fooAtt=\"barVal\"/>"),
+                     std::runtime_error);
+    TS_ASSERT(!fac);
+    delete fac;
+  }
+
+  void test_noURLTag() {
+    const std::string crTxt = "<computeResource name=\"foo\">"
+                              "<u>" +
+                              fermiURL + "</u>"
+                                         "</computeResource>";
+    FacilityInfo *fac = NULL;
+    TS_ASSERT_THROWS(fac = createCRInfoInMinimalFacility(crTxt),
+                     std::runtime_error);
+    TS_ASSERT(!fac);
+    delete fac;
+  }
+
+  void test_wrongXML() {
+    const std::string crTxt = "<computeResource name=\"foo\">"
+                              "<u_foo>" +
+                              fermiURL + "</u_bar>"
+                                         "</compResource>";
+    FacilityInfo *fac = NULL;
+    TS_ASSERT_THROWS(fac = createCRInfoInMinimalFacility(crTxt),
+                     Poco::XML::XMLException);
+    TS_ASSERT(!fac);
+    delete fac;
+  }
+
+  void test_normalFermi() {
+    const std::string fermi = "<computeResource name=\"" + fermiName +
+                              "\">"
+                              "<baseURL>" +
+                              fermiURL + "</baseURL>"
+                                         "</computeResource>";
+
+    FacilityInfo *fac = NULL;
+    TS_ASSERT_THROWS_NOTHING(fac = createCRInfoInMinimalFacility(fermi));
+    TS_ASSERT(fac);
+    TS_ASSERT_EQUALS(fac->name(), this->testFacilityName);
+
+    std::vector<ComputeResourceInfo> cri;
+    TS_ASSERT_THROWS_NOTHING(cri = fac->computeResInfos());
+    TS_ASSERT_EQUALS(cri.size(), 1);
+
+    ComputeResourceInfo cr = fac->computeResInfos().front();
+    TS_ASSERT_THROWS(ComputeResourceInfo fail = fac->computeResource(scarfName),
+                     Mantid::Kernel::Exception::NotFoundError);
+    ComputeResourceInfo cr2 = fac->computeResource(fermiName);
+    TS_ASSERT_EQUALS(cr, cr2);
+    TS_ASSERT_EQUALS(cr, cri.front());
+    TS_ASSERT_EQUALS(cr2, cri.front());
+    TS_ASSERT_EQUALS(cr.name(), fermiName);
+    TS_ASSERT_EQUALS(cr2.name(), fermiName);
+    TS_ASSERT_EQUALS(cr.baseURL(), fermiURL);
+    TS_ASSERT_EQUALS(cr2.baseURL(), fermiURL);
+    TS_ASSERT_EQUALS(cr.remoteJobManagerType(), defaultType);
+    TS_ASSERT_EQUALS(cr2.remoteJobManagerType(), defaultType);
+    TS_ASSERT_EQUALS(cr.facility().name(), fac->name());
+    TS_ASSERT_EQUALS(cr2.facility().name(), fac->name());
+  }
+
+  void test_brokenFermi() {
+    // wrong 'baseURL' tag
+    const std::string fermi = "<computeResource name=\"" + fermiName + "\">"
+                                                                       "<URL>" +
+                              fermiURL + "</URL>"
+                                         "</computeResource>";
+
+    FacilityInfo *fac = NULL;
+    TS_ASSERT_THROWS(fac = createCRInfoInMinimalFacility(fermi),
+                     std::runtime_error);
+
+    TS_ASSERT(!fac);
+    delete fac;
+  }
+
+  void test_normalSCARF() {
+    const std::string scarf = "<computeResource name=\"" + scarfName +
+                              "\" JobManagerType=\"" + scarfType + "\">"
+                                                                   "<baseURL>" +
+                              scarfURL + "</baseURL>"
+                                         "</computeResource>";
+
+    FacilityInfo *fac = NULL;
+    TS_ASSERT_THROWS_NOTHING(fac = createCRInfoInMinimalFacility(scarf));
+    TS_ASSERT(fac);
+    TS_ASSERT_EQUALS(fac->name(), this->testFacilityName);
+    std::vector<ComputeResourceInfo> cri;
+    TS_ASSERT_THROWS_NOTHING(cri = fac->computeResInfos());
+    TS_ASSERT_EQUALS(cri.size(), 1);
+
+    ComputeResourceInfo cr = fac->computeResInfos().front();
+    TS_ASSERT_THROWS(ComputeResourceInfo fail = fac->computeResource("inexistent!"),
+                     Mantid::Kernel::Exception::NotFoundError);
+    ComputeResourceInfo cr2 = fac->computeResource(scarfName);
+    TS_ASSERT_EQUALS(cr, cr2);
+    TS_ASSERT_EQUALS(cri.front(), cr);
+    TS_ASSERT_EQUALS(cri.front(), cr2);
+    TS_ASSERT_EQUALS(scarfName, cr.name());
+    TS_ASSERT_EQUALS(scarfName, cr2.name());
+    TS_ASSERT_EQUALS(scarfURL, cr.baseURL());
+    TS_ASSERT_EQUALS(scarfURL, cr2.baseURL());
+    TS_ASSERT_EQUALS(scarfType, cr.remoteJobManagerType());
+    TS_ASSERT_EQUALS(scarfType, cr2.remoteJobManagerType());
+    TS_ASSERT_EQUALS(fac->name(), cr.facility().name());
+    TS_ASSERT_EQUALS(fac->name(), cr2.facility().name());
+    delete fac;
+  }
+
+  void test_brokenSCARF() {
+    const std::string type = "SCARFLSFJobManager";
+    const std::string err = "<computeResource foo=\"" + scarfName +
+                            "\" JobManagerType=\"" + type + "\">"
+                                                            "<URL>" +
+                            scarfURL + "</URL>"
+                                       "</computeResource>";
+    FacilityInfo *fac = NULL;
+    TS_ASSERT_THROWS(fac = createCRInfoInMinimalFacility(err),
+                     std::runtime_error);
+    TS_ASSERT(!fac);
+    delete fac;
+  }
+
+  void test_equals() {
+    const std::string otherName = "other";
+    const std::string otherURL = "www.example.com/foo/baz";
+    const std::string thirdName = "third";
+    const std::string rep = "<computeResource name=\"" + fermiName +
+                            "\">"
+                            "<baseURL>" +
+                            fermiURL + "</baseURL>"
+                                       "</computeResource>"
+
+                                       "<computeResource name=\"" +
+                            otherName + "\">"
+                                        "<baseURL>" +
+                            otherURL + "</baseURL>"
+                                       "</computeResource>"
+
+                                       "<computeResource name=\"" +
+                            thirdName + "\">"
+                                        "<baseURL>" +
+                            fermiURL + "</baseURL>"
+                                       "</computeResource>"
+
+                                       "<computeResource name=\"" +
+                            fermiName + "\">"
+                                        "<baseURL>" +
+                            fermiURL + "</baseURL>"
+                                       "</computeResource>";
+
+    FacilityInfo *fac = NULL;
+    TS_ASSERT_THROWS_NOTHING(fac = createCRInfoInMinimalFacility(rep));
+    TS_ASSERT(fac);
+    TS_ASSERT_EQUALS(fac->computeResources().size(), 3);
+    TS_ASSERT_EQUALS(fac->computeResInfos().size(), 4);
+
+    // compare names
+    TS_ASSERT(fac->computeResources()[0] == fac->computeResources()[0]);
+    TS_ASSERT(!(fac->computeResources()[0] == fac->computeResources()[1]));
+    TS_ASSERT(!(fac->computeResources()[0] == fac->computeResources()[2]));
+    TS_ASSERT(!(fac->computeResources()[1] == fac->computeResources()[2]));
+
+    // compare full comp resource info
+    TS_ASSERT(fac->computeResInfos()[0] == fac->computeResInfos()[0]);
+    TS_ASSERT(!(fac->computeResInfos()[0] == fac->computeResInfos()[1]));
+    TS_ASSERT(!(fac->computeResInfos()[0] == fac->computeResInfos()[2]));
+    TS_ASSERT(!(fac->computeResInfos()[1] == fac->computeResInfos()[2]));
+    TS_ASSERT(!(fac->computeResInfos()[2] == fac->computeResInfos()[3]));
+    TS_ASSERT(fac->computeResInfos()[0] == fac->computeResInfos()[3]);
+
+    // compare comp resource info retrieved by names
+    TS_ASSERT(
+        !(fac->computeResource(fermiName) == fac->computeResource(otherName)));
+    TS_ASSERT(
+        !(fac->computeResource(fermiName) == fac->computeResource(thirdName)));
+    TS_ASSERT(
+        !(fac->computeResource(otherName) == fac->computeResource(thirdName)));
+    delete fac;
+  }
+
+private:
+  /// make a minimal facilities file/xml string includin the compute resource
+  /// passed
+  FacilityInfo *createCRInfoInMinimalFacility(const std::string &crStr) {
+    const std::string xmlStr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+                               "<facilities>"
+                               "  <facility name=\"" +
+                               testFacilityName +
+                               "\" FileExtensions=\".xyz\">" + simpleInstStr +
+                               crStr + "  </facility>"
+                                       "</facilities>";
+
+    return createFacility(xmlStr);
+  }
+
+  FacilityInfo *createFacility(const std::string &xml) {
+    Poco::XML::DOMParser parser;
+    Poco::AutoPtr<Poco::XML::Document> pDoc = parser.parseString(xml);
+    Poco::XML::Element *pRootElem = pDoc->documentElement();
+    Poco::XML::Element *elem = pRootElem->getChildElement("facility");
+
+    return new FacilityInfo(elem);
+  }
+
+private:
+  // a minimal instrument to create a facility info
+  static const std::string simpleInstStr;
+
+  // default remote job manager type
+  static const std::string defaultType;
+
+  static const std::string testFacilityName;
+
+  static const std::string fermiName;
+  static const std::string fermiURL;
+  static const std::string scarfName;
+  static const std::string scarfURL;
+  static const std::string scarfType;
+};
+
+const std::string ComputeResourceInfoTest::simpleInstStr =
+    "<instrument name=\"AnInst\">"
+    "  <technique>Measuring Stuff</technique>"
+    "</instrument>";
+
+const std::string ComputeResourceInfoTest::defaultType =
+    "MantidWebServiceAPIJobManager";
+
+const std::string ComputeResourceInfoTest::testFacilityName = "ATestFacility";
+
+const std::string ComputeResourceInfoTest::fermiURL =
+    "https://fermi.ornl.gov/MantidRemote";
+const std::string ComputeResourceInfoTest::fermiName = "Fermi";
+const std::string ComputeResourceInfoTest::scarfURL =
+    "https://portal.scarf.rl.ac.uk";
+const std::string ComputeResourceInfoTest::scarfName = "SCARF@STFC";
+const std::string ComputeResourceInfoTest::scarfType = "SCARFLSFJobManager";
+
+#endif // COMPUTERESOURCEINFOTEST_H_
diff --git a/Code/Mantid/Framework/Kernel/test/LogParserTest.h b/Code/Mantid/Framework/Kernel/test/LogParserTest.h
index 790a09ecef129005ab240ca231af12dc70a9345a..8ae8ca0541546eacd71928a4d32878a3b9511353 100644
--- a/Code/Mantid/Framework/Kernel/test/LogParserTest.h
+++ b/Code/Mantid/Framework/Kernel/test/LogParserTest.h
@@ -21,26 +21,30 @@ public:
   static LogParserTest *createSuite() { return new LogParserTest(); }
   static void destroySuite(LogParserTest *suite) { delete suite; }
   
+
+  class TmpFile{
+    Poco::File m_file;
+  public:
+    TmpFile(const std::string& fname):m_file(fname){}
+    ~TmpFile(){remove();}
+    const std::string& path() const {return m_file.path();}
+    bool exists() const {return m_file.exists();}
+    void remove() {if (m_file.exists()) m_file.remove();}
+  };
+
   LogParserTest()
         :log_num_good("TST000000_good.txt"),
          log_num_late("TST000000_late.txt"),
          log_num_early("TST000000_early.txt"),
          log_num_single("TST000000_single.txt"),
          log_str("TST000000_str.txt"),
-         icp_file("TST000000_icpevent.txt")
+         icp_file("TST000000_icpevent.txt"),
+         log_str_repeat("TST000000_repeat.txt"),
+         log_num_repeat("TST000000_num_repeat.txt"),
+         log_str_continuations("TST000000_str_continue.txt")
     {
     }
   
-  ~LogParserTest()
-    {
-      if ( log_num_good.exists() ) log_num_good.remove();
-      if ( log_num_late.exists() ) log_num_late.remove();
-      if ( log_num_early.exists() ) log_num_early.remove();
-      if ( log_num_single.exists() ) log_num_single.remove();
-      if ( log_str.exists() ) log_str.remove();
-      if ( icp_file.exists() ) icp_file.remove();
-    }
-  
     void testGood()
     {
         mkICP();
@@ -515,7 +519,67 @@ public:
         delete log;
     }
 
-//*/
+    void test_str_repeat()
+    {
+      mkStrRepeat();
+      Property *prop = LogParser::createLogProperty(log_str_repeat.path(),"log");
+      const auto *log = dynamic_cast<const TimeSeriesProperty<std::string>*>(prop);
+      TS_ASSERT(log);
+      auto logm = log->valueAsMultiMap();
+      auto it = logm.begin();
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:34");
+      TS_ASSERT_EQUALS( it->second, "   First line"); ++it;
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:34");
+      TS_ASSERT_EQUALS( it->second, "   Second line"); ++it;
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33");
+      TS_ASSERT_EQUALS( it->second, "   First line"); ++it;
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33");
+      TS_ASSERT_EQUALS( it->second, "   Second line"); ++it;
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33");
+      TS_ASSERT_EQUALS( it->second, "   Third line"); ++it;
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33");
+      TS_ASSERT_EQUALS( it->second, "   Fourth line"); ++it;
+    }
+
+    void test_num_repeat()
+    {
+      mkNumRepeat();
+      Property *prop = LogParser::createLogProperty(log_str_repeat.path(),"log");
+      const auto *log = dynamic_cast<const TimeSeriesProperty<double>*>(prop);
+      TS_ASSERT(log);
+      auto logm = log->valueAsMultiMap();
+      auto it = logm.begin();
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:34");
+      TS_ASSERT_EQUALS( it->second, 1); ++it;
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:34");
+      TS_ASSERT_EQUALS( it->second, 2); ++it;
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33");
+      TS_ASSERT_EQUALS( it->second, 3); ++it;
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33");
+      TS_ASSERT_EQUALS( it->second, 4); ++it;
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33");
+      TS_ASSERT_EQUALS( it->second, 5); ++it;
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33");
+      TS_ASSERT_EQUALS( it->second, 6); ++it;
+    }
+
+    void test_str_continuation()
+    {
+      mkStrContinuations();
+      Property *prop = LogParser::createLogProperty(log_str_continuations.path(),"log");
+      const auto *log = dynamic_cast<const TimeSeriesProperty<std::string>*>(prop);
+      TS_ASSERT(log);
+      auto logm = log->valueAsMultiMap();
+      auto it = logm.begin();
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:31");
+      TS_ASSERT_EQUALS( it->second, "   First line Second line"); ++it;
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:34");
+      TS_ASSERT_EQUALS( it->second, "   First line"); ++it;
+      TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:34");
+      TS_ASSERT_EQUALS( it->second, "   Second line Third line"); ++it;
+    }
+
+
 private:
 
     /// Helper method to run common test code for checking period logs.
@@ -646,13 +710,52 @@ private:
         f << "2000-09-05T14:03:56   line "<<9<<'\n';
         f.close();
     }
-//*/
-    Poco::File log_num_good;// run time interval is within first - last times of the log
-    Poco::File log_num_late;// first time is later than run start
-    Poco::File log_num_early;// last time is earlier than run ends
-    Poco::File log_num_single;// single value
-    Poco::File log_str;// file of strings
-    Poco::File icp_file;// icpevent file
+
+    void mkStrContinuations()
+    {
+      std::ofstream f( log_str_continuations.path().c_str() );
+      f << "2000-09-05T12:22:31   First line" << std::endl;
+      f << "Second line" << std::endl;
+      f << "2000-09-05T12:22:34   First line" << std::endl;
+      f << "2000-09-05T12:22:34   Second line" << std::endl;
+      f << "Third line" << std::endl;
+      f.close();
+    }
+
+    void mkStrRepeat()
+    {
+      std::ofstream f( log_str_repeat.path().c_str() );
+      f << "2000-09-05T12:22:34   First line" << std::endl;
+      f << "2000-09-05T12:22:34   Second line" << std::endl;
+      f << "2000-09-05T12:23:33   First line" << std::endl;
+      f << "2000-09-05T12:23:33   Second line" << std::endl;
+      f << "2000-09-05T12:23:33   Third line" << std::endl;
+      f << "2000-09-05T12:23:33   Fourth line" << std::endl;
+      f.close();
+    }
+
+    void mkNumRepeat()
+    {
+      std::ofstream f( log_str_repeat.path().c_str() );
+      f << "2000-09-05T12:22:34   1" << std::endl;
+      f << "2000-09-05T12:22:34   2" << std::endl;
+      f << "2000-09-05T12:23:33   3" << std::endl;
+      f << "2000-09-05T12:23:33   4" << std::endl;
+      f << "2000-09-05T12:23:33   5" << std::endl;
+      f << "2000-09-05T12:23:33   6" << std::endl;
+      f.close();
+    }
+
+    TmpFile log_num_good;// run time interval is within first - last times of the log
+    TmpFile log_num_late;// first time is later than run start
+    TmpFile log_num_early;// last time is earlier than run ends
+    TmpFile log_num_single;// single value
+    TmpFile log_str;// file of strings
+    TmpFile icp_file;// icpevent file
+    TmpFile log_str_repeat;// string log with repeating lines
+    TmpFile log_num_repeat;// num log with repeating lines
+    TmpFile log_str_continuations;// string log with continuation lines
+
     tm ti_data;
     tm * ti;
 
diff --git a/Code/Mantid/Framework/Kernel/test/MatrixTest.h b/Code/Mantid/Framework/Kernel/test/MatrixTest.h
index f504f2436584fd6ddbb0407757b79181d011cd9e..d27c2752545a5db01a97b8d5f1eaa373d09d14bc 100644
--- a/Code/Mantid/Framework/Kernel/test/MatrixTest.h
+++ b/Code/Mantid/Framework/Kernel/test/MatrixTest.h
@@ -429,6 +429,18 @@ public:
 
        DblMatrix M4(4,4, true);
        TS_ASSERT_THROWS(M4.operator *(v), Mantid::Kernel::Exception::MisMatch<size_t>);
+
+       DblMatrix M23 = boost::lexical_cast<DblMatrix>("Matrix(2,3)-0.23,0.55,5.22,2.96,4.2,0.1");
+       TS_ASSERT_THROWS_NOTHING(M23.operator *(v));
+
+       nv = M23 * v;
+
+       TS_ASSERT_DELTA(nv.X(), -0.403000000000000, 1e-15);
+       TS_ASSERT_DELTA(nv.Y(), 25.663000000000000, 1e-15);
+       TS_ASSERT_EQUALS(nv.Z(), 0);
+
+       DblMatrix M43 = boost::lexical_cast<DblMatrix>("Matrix(4,3)-0.23,0.55,5.22,2.96,4.2,0.1,-0.23,0.55,5.22,2.96,4.2,0.1");
+       TS_ASSERT_THROWS(M43.operator *(v), Mantid::Kernel::Exception::MisMatch<size_t>);
    }
 
 private:
diff --git a/Code/Mantid/Framework/Kernel/test/TypedValidatorTest.h b/Code/Mantid/Framework/Kernel/test/TypedValidatorTest.h
index 79693e0335b907b382276d7af79fe0d79df1b35e..124c4655af43968e5e8870184ca6d14dc11447ef 100644
--- a/Code/Mantid/Framework/Kernel/test/TypedValidatorTest.h
+++ b/Code/Mantid/Framework/Kernel/test/TypedValidatorTest.h
@@ -24,8 +24,8 @@ namespace
   /// Dummy object to hold in a shared_ptr for test
   struct Holder
   {};
-  DECLARE_TEST_VALIDATOR(SharedPtrTypedValidator, boost::shared_ptr<Holder>);
-  DECLARE_TEST_VALIDATOR(PODTypedValidator, double);
+  DECLARE_TEST_VALIDATOR(SharedPtrTypedValidator, boost::shared_ptr<Holder>)
+  DECLARE_TEST_VALIDATOR(PODTypedValidator, double)
   class FakeDataItem : public Mantid::Kernel::DataItem
   {
   public:
@@ -34,7 +34,7 @@ namespace
     virtual bool threadSafe() const { return true; }
     virtual const std::string toString() const { return "FakeDataItem{}"; }
   };
-  DECLARE_TEST_VALIDATOR(DataItemSptrTypedValidator, boost::shared_ptr<FakeDataItem>);
+  DECLARE_TEST_VALIDATOR(DataItemSptrTypedValidator, boost::shared_ptr<FakeDataItem>)
 }
 
 class TypedValidatorTest : public CxxTest::TestSuite
diff --git a/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARA.h b/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARA.h
index a6a6afb3ab1174cde48df20cd7fe88262f914229..97757097758d85b050ce3f1a78373f04c0422f3b 100644
--- a/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARA.h
+++ b/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARA.h
@@ -29,7 +29,7 @@ enum Enum {
   DEVICE_DESC_V0 = ADARA_PKT_TYPE(0x8000, 0),
   VAR_VALUE_U32_V0 = ADARA_PKT_TYPE(0x8001, 0),
   VAR_VALUE_DOUBLE_V0 = ADARA_PKT_TYPE(0x8002, 0),
-  VAR_VALUE_STRING_V0 = ADARA_PKT_TYPE(0x8003, 0),
+  VAR_VALUE_STRING_V0 = ADARA_PKT_TYPE(0x8003, 0)
 };
 }
 
@@ -57,7 +57,7 @@ enum Enum {
   RUN_EOF = 2,
   RUN_BOF = 3,
   END_RUN = 4,
-  STATE = 5,
+  STATE = 5
 };
 }
 
@@ -86,7 +86,7 @@ enum Enum {
   READ_PERMISSION = 20,
   WRITE_PERMISSION = 21,
   UPSTREAM_DISCONNECTED = 0xfffe,
-  NOT_REPORTED = 0xffff,
+  NOT_REPORTED = 0xffff
 };
 }
 
@@ -96,7 +96,7 @@ enum Enum {
   MINOR_ALARM = 1,
   MAJOR_ALARM = 2,
   INVALID = 3,
-  NOT_REPORTED = 0xffff,
+  NOT_REPORTED = 0xffff
 };
 }
 
@@ -107,7 +107,7 @@ enum Enum {
   SCAN_STOP,
   PAUSE,
   RESUME,
-  OVERALL_RUN_COMMENT,
+  OVERALL_RUN_COMMENT
 };
 }
 
diff --git a/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARAPackets.h b/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARAPackets.h
index a331a294c25be99a9d50e658c62709bdafcda8ed..9a616c43892aa2a1c6b4dd1beba99e4ca39b8a34 100644
--- a/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARAPackets.h
+++ b/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARAPackets.h
@@ -162,7 +162,7 @@ public:
     PULSE_VETO = 0x0004,
     MISSING_RTDL = 0x0008,
     MAPPING_ERROR = 0x0010,
-    DUPLICATE_PULSE = 0x0020,
+    DUPLICATE_PULSE = 0x0020
   };
 
   uint32_t pulseCharge(void) const { return m_fields[0]; }
diff --git a/Code/Mantid/Framework/LiveData/src/MonitorLiveData.cpp b/Code/Mantid/Framework/LiveData/src/MonitorLiveData.cpp
index 8262af09878fcd413bb35dd9f0e4ab68a3f1991c..8491c3d349bd8ed0a88cac9f96dca443b0751c40 100644
--- a/Code/Mantid/Framework/LiveData/src/MonitorLiveData.cpp
+++ b/Code/Mantid/Framework/LiveData/src/MonitorLiveData.cpp
@@ -27,7 +27,7 @@ MonitorLiveData::~MonitorLiveData() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string MonitorLiveData::name() const { return "MonitorLiveData"; };
+const std::string MonitorLiveData::name() const { return "MonitorLiveData"; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string MonitorLiveData::category() const {
@@ -35,7 +35,7 @@ const std::string MonitorLiveData::category() const {
 }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int MonitorLiveData::version() const { return 1; };
+int MonitorLiveData::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Code/Mantid/Framework/LiveData/src/SNSLiveEventDataListener.cpp b/Code/Mantid/Framework/LiveData/src/SNSLiveEventDataListener.cpp
index 50b2621e222a875ff79329ac62cbbd9eea9042fa..b70faa984ea971d86863d6abf400c57b43878652 100644
--- a/Code/Mantid/Framework/LiveData/src/SNSLiveEventDataListener.cpp
+++ b/Code/Mantid/Framework/LiveData/src/SNSLiveEventDataListener.cpp
@@ -54,7 +54,7 @@ Mantid::Kernel::DateAndTime timeFromPacket(const ADARA::PacketHeader &hdr) {
 
 namespace Mantid {
 namespace LiveData {
-DECLARE_LISTENER(SNSLiveEventDataListener);
+DECLARE_LISTENER(SNSLiveEventDataListener)
 // The DECLARE_LISTENER macro seems to confuse some editors' syntax checking.
 // The semi-colon limits the complaints to one line.  It has no actual effect
 // on the code.
diff --git a/Code/Mantid/Framework/LiveData/src/StartLiveData.cpp b/Code/Mantid/Framework/LiveData/src/StartLiveData.cpp
index c890cac2ab60164159a93dfc879f7b6d09ae08b1..49338ad3a41d5354587d1086600e12dd764cbca0 100644
--- a/Code/Mantid/Framework/LiveData/src/StartLiveData.cpp
+++ b/Code/Mantid/Framework/LiveData/src/StartLiveData.cpp
@@ -37,10 +37,10 @@ StartLiveData::~StartLiveData() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string StartLiveData::name() const { return "StartLiveData"; };
+const std::string StartLiveData::name() const { return "StartLiveData"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int StartLiveData::version() const { return 1; };
+int StartLiveData::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/CachedExperimentInfo.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/CachedExperimentInfo.h
index a4a590186b0c79b7b8e6aa4af5c7f2ad45d74da1..22d7b317caca9200217f48f58c4e69206f283b47 100644
--- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/CachedExperimentInfo.h
+++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/CachedExperimentInfo.h
@@ -78,8 +78,8 @@ public:
   const Kernel::DblMatrix &sampleToDetectorTransform() const;
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(CachedExperimentInfo);
-  DISABLE_COPY_AND_ASSIGN(CachedExperimentInfo);
+  DISABLE_DEFAULT_CONSTRUCT(CachedExperimentInfo)
+  DISABLE_COPY_AND_ASSIGN(CachedExperimentInfo)
 
   /// Cache frequently used values
   void initCaches(const Geometry::Instrument_const_sptr &instrument,
diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModel.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModel.h
index a7e03768a32fd3b2000bfb3d5f3bb32032be6434..29a258d31bf3f6ca32fb2e4cd5d7d64d80eefe5e 100644
--- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModel.h
+++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModel.h
@@ -107,7 +107,7 @@ protected:
                            double &arlu2, double &arlu3);
 
 private:
-  DISABLE_COPY_AND_ASSIGN(ForegroundModel);
+  DISABLE_COPY_AND_ASSIGN(ForegroundModel)
 
   /// Required by the interface
   void function(const Mantid::API::FunctionDomain &,
diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModelFactory.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModelFactory.h
index 7a2ce0cf3e3612d6d2dcb743a56b968a8fd4dcc9..5bb9e80788bd51ee5eaf9c963a97c4494df16fff 100644
--- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModelFactory.h
+++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModelFactory.h
@@ -57,7 +57,7 @@ private:
   friend struct Kernel::CreateUsingNew<ForegroundModelFactoryImpl>;
   /// Default constructor
   ForegroundModelFactoryImpl();
-  DISABLE_COPY_AND_ASSIGN(ForegroundModelFactoryImpl);
+  DISABLE_COPY_AND_ASSIGN(ForegroundModelFactoryImpl)
 
   // Do not allow the default create & createUnwrapped to be called
   using BaseClass::create;
diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolution.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolution.h
index 5e2184882dc6a25a9c0f356a0262e63c01634799..3be84661565fd8ac0f3fc307d23f19cff6c0de35 100644
--- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolution.h
+++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolution.h
@@ -117,7 +117,7 @@ protected:
   const API::IFunctionMD &getFittingFunction() const;
 
 private:
-  DISABLE_COPY_AND_ASSIGN(MDResolutionConvolution);
+  DISABLE_COPY_AND_ASSIGN(MDResolutionConvolution)
 
   /// Required for function interface
   void function(const Mantid::API::FunctionDomain &,
diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolutionFactory.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolutionFactory.h
index 1c3d66d59226403d81849b1d8dc03c3177062214..005d9af1314d58cff2318dc97757c62c9421ac9d 100644
--- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolutionFactory.h
+++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolutionFactory.h
@@ -56,7 +56,7 @@ private:
   friend struct Kernel::CreateUsingNew<MDResolutionConvolutionFactoryImpl>;
   /// Default constructor. Private for singleton holder
   MDResolutionConvolutionFactoryImpl();
-  DISABLE_COPY_AND_ASSIGN(MDResolutionConvolutionFactoryImpl);
+  DISABLE_COPY_AND_ASSIGN(MDResolutionConvolutionFactoryImpl)
 
   // Do not allow the default create & createUnwrapped to be called
   using BaseClass::create;
diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/ModeratorChopperResolution.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/ModeratorChopperResolution.h
index 27fea7faefbac98040ebadb3886623ba0aa457c7..429d7b56bf1588ed79b7b9cb86553b1f7355a65a 100644
--- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/ModeratorChopperResolution.h
+++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/ModeratorChopperResolution.h
@@ -57,8 +57,8 @@ public:
   double energyWidth(const double deltaE) const;
 
 private:
-  DISABLE_DEFAULT_CONSTRUCT(ModeratorChopperResolution);
-  DISABLE_COPY_AND_ASSIGN(ModeratorChopperResolution);
+  DISABLE_DEFAULT_CONSTRUCT(ModeratorChopperResolution)
+  DISABLE_COPY_AND_ASSIGN(ModeratorChopperResolution)
 
   /// Store required cached variables
   void initCaches();
diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitResolutionModel.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitResolutionModel.h
index 11822cc28d3011687cc3b3a893ac99a98e600ae3..df512cf7df717e31497dedea0884405f14edbdb6 100644
--- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitResolutionModel.h
+++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitResolutionModel.h
@@ -77,7 +77,7 @@ public:
                         const size_t eventIndex) const;
 
 private:
-  DISABLE_COPY_AND_ASSIGN(TobyFitResolutionModel);
+  DISABLE_COPY_AND_ASSIGN(TobyFitResolutionModel)
 
   friend class TobyFitYVector;
 
diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitYVector.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitYVector.h
index d5dd3631ca876f3b1268deeac7952cde1f0b4512..6993c3e3656b5c0fe61dc6e7d40c21121b48ddb2 100644
--- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitYVector.h
+++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitYVector.h
@@ -77,7 +77,7 @@ public:
         8, // width-coordinate of point of detection in detector frame
     DetectorHeightCoord =
         9, // height-coordinate of point of detection in detector frame
-    DetectionTime = 10, // deviation in detection time of neutron
+    DetectionTime = 10 // deviation in detection time of neutron
   };
 
   /// Returns the number of parameters, i.e. length of the Y vector
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/BinaryOperationMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/BinaryOperationMD.cpp
index 25df96e70db068bc281742a0960715b5d9c93183..58c4371b8964673c701097e2c686cd42f76d7639 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/BinaryOperationMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/BinaryOperationMD.cpp
@@ -32,10 +32,10 @@ BinaryOperationMD::~BinaryOperationMD() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string BinaryOperationMD::name() const {
   return "BinaryOperationMD";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int BinaryOperationMD::version() const { return 1; };
+int BinaryOperationMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string BinaryOperationMD::category() const {
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/BooleanBinaryOperationMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/BooleanBinaryOperationMD.cpp
index 0b78b3f013d5c14109f6facceba3a856d4a2daa0..40d804e3ca3e3a6cdd754673f4a46c6c97731035 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/BooleanBinaryOperationMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/BooleanBinaryOperationMD.cpp
@@ -22,10 +22,10 @@ BooleanBinaryOperationMD::~BooleanBinaryOperationMD() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string BooleanBinaryOperationMD::name() const {
   return "BooleanBinaryOperationMD";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int BooleanBinaryOperationMD::version() const { return 1; };
+int BooleanBinaryOperationMD::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 ///
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp b/Code/Mantid/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp
index 5f724195c20aeb1195159bdd76bb64397a2746cb..bf8e2b171d087986687d723b52f7e0a4f54c0522 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp
@@ -52,7 +52,7 @@ const std::string CalculateCoverageDGS::name() const {
 }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CalculateCoverageDGS::version() const { return 1; };
+int CalculateCoverageDGS::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CalculateCoverageDGS::category() const {
@@ -63,7 +63,7 @@ const std::string CalculateCoverageDGS::category() const {
 const std::string CalculateCoverageDGS::summary() const {
   return "Calculate the reciprocal space coverage for direct geometry "
          "spectrometers";
-};
+}
 
 /**
 *Stores the X values from each H,K,L dimension as member variables
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp b/Code/Mantid/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp
index e261dc45a8744e5d0aa03a5e21971d6b6662613d..7eb692273ab5a80a0fdca343c938b3cc56d9ac7c 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp
@@ -43,10 +43,10 @@ CompareMDWorkspaces::~CompareMDWorkspaces() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string CompareMDWorkspaces::name() const {
   return "CompareMDWorkspaces";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CompareMDWorkspaces::version() const { return 1; };
+int CompareMDWorkspaces::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CompareMDWorkspaces::category() const {
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/ConvToMDBase.cpp b/Code/Mantid/Framework/MDAlgorithms/src/ConvToMDBase.cpp
index 249d6c6dd20db71a4d5c14e83671e481ff6e65c3..133cdb99934cf54d248bddcec69426d7de8afcb9 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/ConvToMDBase.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/ConvToMDBase.cpp
@@ -94,7 +94,7 @@ size_t ConvToMDBase::initialize(
   m_coordinateSystem = WSD.getCoordinateSystem();
 
   return n_spectra;
-};
+}
 
 /** empty default constructor */
 ConvToMDBase::ConvToMDBase()
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToDetectorFaceMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToDetectorFaceMD.cpp
index c713c7e2ef5e68a6744252d6c04aee901c5273e3..293bfe9ae066160d13c5b8684ad95440f3a3c495 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToDetectorFaceMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToDetectorFaceMD.cpp
@@ -37,10 +37,10 @@ ConvertToDetectorFaceMD::~ConvertToDetectorFaceMD() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string ConvertToDetectorFaceMD::name() const {
   return "ConvertToDetectorFaceMD";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ConvertToDetectorFaceMD::version() const { return 1; };
+int ConvertToDetectorFaceMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ConvertToDetectorFaceMD::category() const {
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp
index 927ea3b76613b495ef9a9944588dafff353e42e0..bc71233a2de536ebd9985bcc0af62d46784e2e72 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp
@@ -140,10 +140,10 @@ ConvertToReflectometryQ::~ConvertToReflectometryQ() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string ConvertToReflectometryQ::name() const {
   return "ConvertToReflectometryQ";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ConvertToReflectometryQ::version() const { return 1; };
+int ConvertToReflectometryQ::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ConvertToReflectometryQ::category() const {
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/CreateMDHistoWorkspace.cpp b/Code/Mantid/Framework/MDAlgorithms/src/CreateMDHistoWorkspace.cpp
index d0cad8d73f5f4c2988ed4aea1eb149509e94d786..a312ee39c8481fe6dc9ac72f824f9c0d99b0eab5 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/CreateMDHistoWorkspace.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/CreateMDHistoWorkspace.cpp
@@ -32,10 +32,10 @@ CreateMDHistoWorkspace::~CreateMDHistoWorkspace() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string CreateMDHistoWorkspace::name() const {
   return "CreateMDHistoWorkspace";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int CreateMDHistoWorkspace::version() const { return 1; };
+int CreateMDHistoWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string CreateMDHistoWorkspace::category() const {
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/DivideMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/DivideMD.cpp
index 47e91c82844caa330ff9b2324368776ba99e5f93..7174d81d5f25736b46c1103d1e2c4e7dbf466982 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/DivideMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/DivideMD.cpp
@@ -27,10 +27,10 @@ DivideMD::~DivideMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string DivideMD::name() const { return "DivideMD"; };
+const std::string DivideMD::name() const { return "DivideMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int DivideMD::version() const { return 1; };
+int DivideMD::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/EqualToMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/EqualToMD.cpp
index cc71408a78a9fda73253f728172e58f45c190192..010147432ff6254911480c1a7bf3d900cf38aa07 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/EqualToMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/EqualToMD.cpp
@@ -22,10 +22,10 @@ EqualToMD::~EqualToMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string EqualToMD::name() const { return "EqualToMD"; };
+const std::string EqualToMD::name() const { return "EqualToMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int EqualToMD::version() const { return 1; };
+int EqualToMD::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 /// Extra properties
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/EvaluateMDFunction.cpp b/Code/Mantid/Framework/MDAlgorithms/src/EvaluateMDFunction.cpp
index d395663cb7ba0c9a4e7ba66da6f99c2c623059ea..10f64648dac48e419b604e4d4ccf328f30a3c3ad 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/EvaluateMDFunction.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/EvaluateMDFunction.cpp
@@ -28,7 +28,7 @@ EvaluateMDFunction::~EvaluateMDFunction() {}
 //----------------------------------------------------------------------------------------------
 
 /// Algorithm's version for identification. @see Algorithm::version
-int EvaluateMDFunction::version() const { return 1; };
+int EvaluateMDFunction::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string EvaluateMDFunction::category() const {
@@ -38,7 +38,7 @@ const std::string EvaluateMDFunction::category() const {
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string EvaluateMDFunction::summary() const {
   return "Evaluates an MD function on a MD histo workspace.";
-};
+}
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/ExponentialMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/ExponentialMD.cpp
index 7c85c07a7df2b982b982f246ac0e74ca138d9a3b..505bf3849f0a6182c6539d3e43f04298355f7055 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/ExponentialMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/ExponentialMD.cpp
@@ -22,10 +22,10 @@ ExponentialMD::~ExponentialMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string ExponentialMD::name() const { return "ExponentialMD"; };
+const std::string ExponentialMD::name() const { return "ExponentialMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ExponentialMD::version() const { return 1; };
+int ExponentialMD::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/GreaterThanMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/GreaterThanMD.cpp
index 4f3477ff9c3a756d737ca52beced138c5615aec0..ebc636a082ca7552af1c7cbe24f66333065ff6c2 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/GreaterThanMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/GreaterThanMD.cpp
@@ -22,10 +22,10 @@ GreaterThanMD::~GreaterThanMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string GreaterThanMD::name() const { return "GreaterThanMD"; };
+const std::string GreaterThanMD::name() const { return "GreaterThanMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int GreaterThanMD::version() const { return 1; };
+int GreaterThanMD::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 /// Run the algorithm with a MDHisotWorkspace as output and operand
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/ImportMDEventWorkspace.cpp b/Code/Mantid/Framework/MDAlgorithms/src/ImportMDEventWorkspace.cpp
index bf7b920e5b892a24fdd51045ab8e8c16fc3615d3..c69bfc19c71d4b5a4fd5b7d0930ed353f1f58517 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/ImportMDEventWorkspace.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/ImportMDEventWorkspace.cpp
@@ -85,10 +85,10 @@ ImportMDEventWorkspace::~ImportMDEventWorkspace() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string ImportMDEventWorkspace::name() const {
   return "ImportMDEventWorkspace";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ImportMDEventWorkspace::version() const { return 1; };
+int ImportMDEventWorkspace::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ImportMDEventWorkspace::category() const {
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/IntegrateFlux.cpp b/Code/Mantid/Framework/MDAlgorithms/src/IntegrateFlux.cpp
index 95092d1e84b71a6861640f5a7c625af08da2b0a3..1bb592d391f31166d9f19264859e0dc2902c551d 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/IntegrateFlux.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/IntegrateFlux.cpp
@@ -32,7 +32,7 @@ public:
 const std::string IntegrateFlux::name() const { return "IntegrateFlux"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int IntegrateFlux::version() const { return 1; };
+int IntegrateFlux::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string IntegrateFlux::category() const { return "MDAlgorithms"; }
@@ -40,7 +40,7 @@ const std::string IntegrateFlux::category() const { return "MDAlgorithms"; }
 /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
 const std::string IntegrateFlux::summary() const {
   return "Interates spectra in a matrix workspace at a set of points.";
-};
+}
 
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp b/Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp
index dff8679ce775cd3400a365264b6c916001e103cb..297a3a9ac3e8dc118faaec195c4e511b793347c5 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp
@@ -103,10 +103,12 @@ void IntegratePeaksMD2::init() {
       "Only warning if all of peak outer radius is not on detector (default).\n"
       "If false, do not integrate if the outer radius is not on a detector.");
 
-  declareProperty("AdaptiveQRadius", false,
-                  "Default is false.   If true, all input radii are multiplied "
-                  "by the magnitude of Q at the peak center so each peak has a "
-                  "different integration radius.  Q includes the 2*pi factor.");
+  declareProperty("AdaptiveQBackground", false,
+      "Default is false.   If true, all background values"
+      "vary on a line so that they are"
+      "background plus AdaptiveQMultiplier multiplied"
+      "by the magnitude of Q at the peak center so each peak has a "
+      "different integration radius.  Q includes the 2*pi factor.");
 
   declareProperty("Cylinder", false,
                   "Default is sphere.  Use next five parameters for cylinder.");
@@ -142,6 +144,12 @@ void IntegratePeaksMD2::init() {
       new FileProperty("ProfilesFile", "", FileProperty::OptionalSave,
                        std::vector<std::string>(1, "profiles")),
       "Save (Optionally) as Isaw peaks file with profiles included");
+
+  declareProperty("AdaptiveQMultiplier", 0.0,
+                  "Peak integration radius varies on a line so that it is"
+                  "PeakRadius plus this value multiplied"
+                  "by the magnitude of Q at the peak center so each peak has a "
+                  "different integration radius.  Q includes the 2*pi factor.");
 }
 
 //----------------------------------------------------------------------------------------------
@@ -191,7 +199,10 @@ void IntegratePeaksMD2::integrate(typename MDEventWorkspace<MDE, nd>::sptr ws) {
   Workspace2D_sptr wsProfile2D, wsFit2D, wsDiff2D;
   size_t numSteps = 0;
   bool cylinderBool = getProperty("Cylinder");
-  bool adaptiveQRadius = getProperty("AdaptiveQRadius");
+  bool adaptiveQBackground = getProperty("AdaptiveQBackground");
+  double adaptiveQMultiplier = getProperty("AdaptiveQMultiplier");
+  double adaptiveQBackgroundMultiplier = 0.0;
+  if (adaptiveQBackground) adaptiveQBackgroundMultiplier = adaptiveQMultiplier;
   std::vector<double> PeakRadiusVector(peakWS->getNumberPeaks(), PeakRadius);
   std::vector<double> BackgroundInnerRadiusVector(peakWS->getNumberPeaks(),
                                                   BackgroundInnerRadius);
@@ -316,8 +327,8 @@ void IntegratePeaksMD2::integrate(typename MDEventWorkspace<MDE, nd>::sptr ws) {
     double background_total = 0.0;
     if (!cylinderBool) {
       // modulus of Q
-      coord_t lenQpeak = 1.0;
-      if (adaptiveQRadius) {
+      coord_t lenQpeak = 0.0;
+      if (adaptiveQMultiplier > 0.0) {
         lenQpeak = 0.0;
         for (size_t d = 0; d < nd; d++) {
           lenQpeak += center[d] * center[d];
@@ -325,9 +336,9 @@ void IntegratePeaksMD2::integrate(typename MDEventWorkspace<MDE, nd>::sptr ws) {
         lenQpeak = std::sqrt(lenQpeak);
       }
 
-      PeakRadiusVector[i] = lenQpeak * PeakRadius;
-      BackgroundInnerRadiusVector[i] = lenQpeak * BackgroundInnerRadius;
-      BackgroundOuterRadiusVector[i] = lenQpeak * BackgroundOuterRadius;
+      PeakRadiusVector[i] = adaptiveQMultiplier * lenQpeak + PeakRadius;
+      BackgroundInnerRadiusVector[i] = adaptiveQBackgroundMultiplier * lenQpeak + BackgroundInnerRadius;
+      BackgroundOuterRadiusVector[i] = adaptiveQBackgroundMultiplier * lenQpeak + BackgroundOuterRadius;
       CoordTransformDistance sphere(nd, center, dimensionsUsed);
 
       if(Peak* shapeablePeak = dynamic_cast<Peak*>(&p)){
@@ -340,7 +351,7 @@ void IntegratePeaksMD2::integrate(typename MDEventWorkspace<MDE, nd>::sptr ws) {
       // Perform the integration into whatever box is contained within.
       ws->getBox()->integrateSphere(
           sphere,
-          static_cast<coord_t>(lenQpeak * PeakRadius * lenQpeak * PeakRadius),
+          static_cast<coord_t>((adaptiveQMultiplier * lenQpeak + PeakRadius) * (adaptiveQMultiplier * lenQpeak + PeakRadius)),
           signal, errorSquared);
 
       // Integrate around the background radius
@@ -348,8 +359,8 @@ void IntegratePeaksMD2::integrate(typename MDEventWorkspace<MDE, nd>::sptr ws) {
       if (BackgroundOuterRadius > PeakRadius) {
         // Get the total signal inside "BackgroundOuterRadius"
         ws->getBox()->integrateSphere(
-            sphere, static_cast<coord_t>(lenQpeak * BackgroundOuterRadius *
-                                         lenQpeak * BackgroundOuterRadius),
+            sphere, static_cast<coord_t>((adaptiveQBackgroundMultiplier * lenQpeak + BackgroundOuterRadius) *
+                                         (adaptiveQBackgroundMultiplier * lenQpeak + BackgroundOuterRadius)),
             bgSignal, bgErrorSquared);
 
         // Evaluate the signal inside "BackgroundInnerRadius"
@@ -359,8 +370,8 @@ void IntegratePeaksMD2::integrate(typename MDEventWorkspace<MDE, nd>::sptr ws) {
         // Integrate this 3rd radius, if needed
         if (BackgroundInnerRadius != PeakRadius) {
           ws->getBox()->integrateSphere(
-              sphere, static_cast<coord_t>(lenQpeak * BackgroundInnerRadius *
-                                           lenQpeak * BackgroundInnerRadius),
+              sphere, static_cast<coord_t>((adaptiveQBackgroundMultiplier * lenQpeak + BackgroundInnerRadius) *
+                                           (adaptiveQBackgroundMultiplier * lenQpeak + BackgroundInnerRadius)),
               interiorSignal, interiorErrorSquared);
         } else {
           // PeakRadius == BackgroundInnerRadius, so use the previous value
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/LessThanMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/LessThanMD.cpp
index 03ac0e684f42b6297dffc2b6e41a5ba1a0502796..089a621bd3839a09e4134762957c888dec7f0d42 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/LessThanMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/LessThanMD.cpp
@@ -22,10 +22,10 @@ LessThanMD::~LessThanMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string LessThanMD::name() const { return "LessThanMD"; };
+const std::string LessThanMD::name() const { return "LessThanMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int LessThanMD::version() const { return 1; };
+int LessThanMD::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 /// Run the algorithm with a MDHisotWorkspace as output and operand
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/LoadILLAscii.cpp b/Code/Mantid/Framework/MDAlgorithms/src/LoadILLAscii.cpp
index ffe7780809d447eac556bd7830af26c2ac0a0d3b..aff2b3ba119c599cda4710ed49aacd27e7034811 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/LoadILLAscii.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/LoadILLAscii.cpp
@@ -82,10 +82,10 @@ int LoadILLAscii::confidence(Kernel::FileDescriptor &descriptor) const {
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string LoadILLAscii::name() const { return "LoadILLAscii"; };
+const std::string LoadILLAscii::name() const { return "LoadILLAscii"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int LoadILLAscii::version() const { return 1; };
+int LoadILLAscii::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string LoadILLAscii::category() const {
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/LoadMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/LoadMD.cpp
index 2858d442d6582d48b5866bf0b78e13d0eb45924e..694014471026ca7fd6e59de755a4f2bb92c69293 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/LoadMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/LoadMD.cpp
@@ -34,7 +34,7 @@ using namespace Mantid::DataObjects;
 namespace Mantid {
 namespace MDAlgorithms {
 
-DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMD);
+DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMD)
 
 //----------------------------------------------------------------------------------------------
 /** Constructor
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/LoadSQW.cpp b/Code/Mantid/Framework/MDAlgorithms/src/LoadSQW.cpp
index 03af7cc96cfb93fa54cf9507d156661d47816649..4f71e5fd9bbf2003ed9e1100f0f7dfa7cd06bf2b 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/LoadSQW.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/LoadSQW.cpp
@@ -43,7 +43,7 @@ template <typename T> T interpretAs(std::vector<char> &Buf, size_t ind = 0) {
 }
 }
 
-DECLARE_FILELOADER_ALGORITHM(LoadSQW);
+DECLARE_FILELOADER_ALGORITHM(LoadSQW)
 
 /// Constructor
 LoadSQW::LoadSQW() : m_fileName(""), m_fileStream(),
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/LogarithmMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/LogarithmMD.cpp
index fe7f59edcae97a72d9b38723bb755972da65a934..bd84bb2ee6762968ca1799f7b38113d73dd5cccd 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/LogarithmMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/LogarithmMD.cpp
@@ -22,10 +22,10 @@ LogarithmMD::~LogarithmMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string LogarithmMD::name() const { return "LogarithmMD"; };
+const std::string LogarithmMD::name() const { return "LogarithmMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int LogarithmMD::version() const { return 1; };
+int LogarithmMD::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MDTransfModQ.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MDTransfModQ.cpp
index 32be4779e4184b7ef12e8cfbf6850b061e5c8321..fe1aecb8937c0377fb03b91a31fc0ee8146c129a 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/MDTransfModQ.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/MDTransfModQ.cpp
@@ -4,7 +4,7 @@
 namespace Mantid {
 namespace MDAlgorithms {
 // register the class, whith conversion factory under ModQ name
-DECLARE_MD_TRANSFID(MDTransfModQ, |Q|);
+DECLARE_MD_TRANSFID(MDTransfModQ, |Q|)
 
 /**method calculates the units, the transformation expects the input ws to be
 in. If the input ws is in different units,
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MDTransfNoQ.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MDTransfNoQ.cpp
index 015c431650992037c66397e8b8f22936e896147e..e7848cc31fc8ed49c2d27c09ed9d69b41747cd1b 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/MDTransfNoQ.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/MDTransfNoQ.cpp
@@ -4,7 +4,7 @@ namespace Mantid {
 namespace MDAlgorithms {
 
 // register the class, whith conversion factory under NoQ name
-DECLARE_MD_TRANSFID(MDTransfNoQ, CopyToMD);
+DECLARE_MD_TRANSFID(MDTransfNoQ, CopyToMD)
 
 /** Method fills-in all additional properties requested by user and not defined
 *by matrix workspace itselt.
@@ -177,7 +177,7 @@ MDTransfNoQ::inputUnitID(Kernel::DeltaEMode::Type mode,
   return pXAxis->unit()->unitID();
 }
 
-MDTransfNoQ::MDTransfNoQ() : m_NMatrixDim(0), m_YAxis(NULL), m_Det(NULL){};
+MDTransfNoQ::MDTransfNoQ() : m_NMatrixDim(0), m_YAxis(NULL), m_Det(NULL){}
 
 } // End MDAlgorighms namespace
 } // End Mantid namespace
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MDTransfQ3D.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MDTransfQ3D.cpp
index fba02a0cb4e2a62b16febd810cb34b975274b6af..87df6285ec46a8be08a5351926f05560b3a938b7 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/MDTransfQ3D.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/MDTransfQ3D.cpp
@@ -4,7 +4,7 @@
 namespace Mantid {
 namespace MDAlgorithms {
 // register the class, whith conversion factory under Q3D name
-DECLARE_MD_TRANSFID(MDTransfQ3D, Q3D);
+DECLARE_MD_TRANSFID(MDTransfQ3D, Q3D)
 
 /** method returns number of matrix dimensions calculated by this class
 * as function of energy analysis mode   */
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MDWSDescription.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MDWSDescription.cpp
index 30ca2ad11cdfb392a92d310f6187d4e6fa8286f1..bb19321d25be4cdeabcabf4f1f1d44cf39dd9c19 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/MDWSDescription.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/MDWSDescription.cpp
@@ -131,7 +131,7 @@ Kernel::Matrix<double> MDWSDescription::getGoniometerMatr() const {
     return m_InWS->run().getGoniometer().getR();
   else
     return Kernel::Matrix<double>(3, 3, true);
-};
+}
 
 /** the function builds MD event WS description from existing workspace.
 * Primary used to obtain existing ws parameters
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MaskMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MaskMD.cpp
index 8a9110bf3397109ae2311f5b0fa2517a6c6a93db..a9f49837d990bb5e67c5bd98502457ec7fea1ae9 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/MaskMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/MaskMD.cpp
@@ -41,10 +41,10 @@ MaskMD::~MaskMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string MaskMD::name() const { return "MaskMD"; };
+const std::string MaskMD::name() const { return "MaskMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int MaskMD::version() const { return 1; };
+int MaskMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string MaskMD::category() const { return "MDAlgorithms"; }
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MergeMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MergeMD.cpp
index a6b9a8240617b3c68b2b297258f08f720cdbbbb6..0c441665f31aa3dac30d220e6b4d973dca69d2b5 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/MergeMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/MergeMD.cpp
@@ -31,10 +31,10 @@ MergeMD::~MergeMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string MergeMD::name() const { return "MergeMD"; };
+const std::string MergeMD::name() const { return "MergeMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int MergeMD::version() const { return 1; };
+int MergeMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string MergeMD::category() const { return "MDAlgorithms"; }
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MinusMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MinusMD.cpp
index 1d6b0053e96ca8598ae8dd719a4fd4b85a425071..88a37ab5534b77f66a26fb77dad7a46629746a62 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/MinusMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/MinusMD.cpp
@@ -27,10 +27,10 @@ MinusMD::~MinusMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string MinusMD::name() const { return "MinusMD"; };
+const std::string MinusMD::name() const { return "MinusMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int MinusMD::version() const { return 1; };
+int MinusMD::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MultiplyMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MultiplyMD.cpp
index e8f065c07a86f0349634082dbb9a1090d3fe58ba..2873d6a079793ec1487fafb9cad836abc1bb6b56 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/MultiplyMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/MultiplyMD.cpp
@@ -27,10 +27,10 @@ MultiplyMD::~MultiplyMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string MultiplyMD::name() const { return "MultiplyMD"; };
+const std::string MultiplyMD::name() const { return "MultiplyMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int MultiplyMD::version() const { return 1; };
+int MultiplyMD::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/NotMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/NotMD.cpp
index f9f079462ef4f5fd205a814b2de33283e9764e3a..bd1c688fc7568651ed003f876001c5ba363af9c7 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/NotMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/NotMD.cpp
@@ -22,10 +22,10 @@ NotMD::~NotMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string NotMD::name() const { return "NotMD"; };
+const std::string NotMD::name() const { return "NotMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int NotMD::version() const { return 1; };
+int NotMD::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/OrMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/OrMD.cpp
index 4be86dd14d9527f2acc3d023c829268290bc21df..478b04d3a7f4b3ae53d68f9253b59de1ef1f19c0 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/OrMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/OrMD.cpp
@@ -22,10 +22,10 @@ OrMD::~OrMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string OrMD::name() const { return "OrMD"; };
+const std::string OrMD::name() const { return "OrMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int OrMD::version() const { return 1; };
+int OrMD::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 /// Run the algorithm with a MDHisotWorkspace as output and operand
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/PowerMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/PowerMD.cpp
index 2162aad8901aadb49a7ca3948c41ac7daa579bb3..0977843f8ec800578cbb4a3fb9ed229cd4bb0572 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/PowerMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/PowerMD.cpp
@@ -22,10 +22,10 @@ PowerMD::~PowerMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string PowerMD::name() const { return "PowerMD"; };
+const std::string PowerMD::name() const { return "PowerMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int PowerMD::version() const { return 1; };
+int PowerMD::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp
index d8cec796d70f6358583a04ad56044434e4e51212..f705eaaab279825cb67247d988d8df4a708ac9db 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp
@@ -12,7 +12,7 @@ namespace MDAlgorithms {
 // Register the algorithm into the AlgorithmFactory
 DECLARE_ALGORITHM(PreprocessDetectorsToMD)
 
-PreprocessDetectorsToMD::PreprocessDetectorsToMD(){};
+PreprocessDetectorsToMD::PreprocessDetectorsToMD(){}
 //----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties. */
 void PreprocessDetectorsToMD::init() {
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/FitResolutionConvolvedModel.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/FitResolutionConvolvedModel.cpp
index dbe2509851495c269337407deaca81965e595799..da845673529edfc948570c4d80e9b8f069538fed 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/FitResolutionConvolvedModel.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/FitResolutionConvolvedModel.cpp
@@ -11,7 +11,7 @@ namespace Mantid {
 namespace MDAlgorithms {
 
 // Register the algorithm into the AlgorithmFactory
-DECLARE_ALGORITHM(FitResolutionConvolvedModel);
+DECLARE_ALGORITHM(FitResolutionConvolvedModel)
 
 using Kernel::Direction;
 using Kernel::ListValidator;
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/MullerAnsatz.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/MullerAnsatz.cpp
index 2afe41cc2bd27c2f0190d6068de0c77809364626..708ae56914c03ee9ad4938bfa320723d869616d1 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/MullerAnsatz.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/MullerAnsatz.cpp
@@ -8,7 +8,7 @@
 
 namespace Mantid {
 namespace MDAlgorithms {
-DECLARE_FOREGROUNDMODEL(MullerAnsatz);
+DECLARE_FOREGROUNDMODEL(MullerAnsatz)
 
 using Kernel::Math::BoseEinsteinDistribution;
 
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/QCoordinate.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/QCoordinate.cpp
index cb3d62350f1796c2e6d54664319eb92c87cdd392..ca3ed919e0adfc35925fd19e0ef7784a792f660a 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/QCoordinate.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/QCoordinate.cpp
@@ -4,7 +4,7 @@
 
 namespace Mantid {
 namespace MDAlgorithms {
-DECLARE_FOREGROUNDMODEL(QCoordinate);
+DECLARE_FOREGROUNDMODEL(QCoordinate)
 
 namespace // anonymous
     {
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/Strontium122.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/Strontium122.cpp
index de1d838c4652b2918a56445d6fb1559d54132a8a..d613b2059c84197dbca84c2f6c78568f2de031cc 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/Strontium122.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/Strontium122.cpp
@@ -5,7 +5,7 @@
 
 namespace Mantid {
 namespace MDAlgorithms {
-DECLARE_FOREGROUNDMODEL(Strontium122);
+DECLARE_FOREGROUNDMODEL(Strontium122)
 
 using Kernel::Math::BoseEinsteinDistribution;
 
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitResolutionModel.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitResolutionModel.cpp
index cabafe77cd995646c07444bad775ff4c91620df6..3ac60433469ce308e37a7b12a96c77ba0420501e 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitResolutionModel.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitResolutionModel.cpp
@@ -23,7 +23,7 @@ using API::Run;
 using API::IFunction;
 
 DECLARE_MDRESOLUTIONCONVOLUTION(TobyFitResolutionModel,
-                                "TobyFitResolutionModel");
+                                "TobyFitResolutionModel")
 
 namespace // anonymous
     {
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/ResolutionConvolvedCrossSection.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/ResolutionConvolvedCrossSection.cpp
index f97d7d352161caa49a8985ba7250716eb6e0dec1..95d0e74c13e3f9c9aebd68ce69d76e3dd1fc72cf 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/ResolutionConvolvedCrossSection.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/ResolutionConvolvedCrossSection.cpp
@@ -52,8 +52,6 @@ namespace MDAlgorithms {
 using namespace DataObjects;
 using namespace Kernel;
 
-DECLARE_FUNCTION(ResolutionConvolvedCrossSection);
-
 namespace {
 // Attribute names
 const char *RESOLUTION_ATTR = "ResolutionFunction";
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/SimulateResolutionConvolvedModel.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/SimulateResolutionConvolvedModel.cpp
index 16e1afb74af32fcd121b142c72537ec107aaa884..f26b4faa128941f25567ee0e83fd27e99bcf339f 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/SimulateResolutionConvolvedModel.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/SimulateResolutionConvolvedModel.cpp
@@ -17,7 +17,7 @@
 namespace Mantid {
 namespace MDAlgorithms {
 // Register the algorithm into the AlgorithmFactory
-DECLARE_ALGORITHM(SimulateResolutionConvolvedModel);
+DECLARE_ALGORITHM(SimulateResolutionConvolvedModel)
 
 using namespace API;
 using namespace DataObjects;
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/SaveZODS.cpp b/Code/Mantid/Framework/MDAlgorithms/src/SaveZODS.cpp
index a2b287855cfde17b42d937da0448a5c5dc09d938..2abfa146132a8a38392c544e0e9d31ec69ca1de5 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/SaveZODS.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/SaveZODS.cpp
@@ -28,10 +28,10 @@ SaveZODS::~SaveZODS() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string SaveZODS::name() const { return "SaveZODS"; };
+const std::string SaveZODS::name() const { return "SaveZODS"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int SaveZODS::version() const { return 1; };
+int SaveZODS::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string SaveZODS::category() const { return "MDAlgorithms"; }
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/SetMDUsingMask.cpp b/Code/Mantid/Framework/MDAlgorithms/src/SetMDUsingMask.cpp
index e145c7857dda37b8fd76e21fb9c76d51857b4145..363f247e208c1e4b57cd3fe7663d88ede5900b4c 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/SetMDUsingMask.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/SetMDUsingMask.cpp
@@ -27,10 +27,10 @@ SetMDUsingMask::~SetMDUsingMask() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string SetMDUsingMask::name() const { return "SetMDUsingMask"; };
+const std::string SetMDUsingMask::name() const { return "SetMDUsingMask"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int SetMDUsingMask::version() const { return 1; };
+int SetMDUsingMask::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string SetMDUsingMask::category() const {
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/ThresholdMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/ThresholdMD.cpp
index 1b98ff136b48c4c0073c7eb095f1cc387670a0a7..41e7566d90898e73f985dca9a6019bdcbf9eaa09 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/ThresholdMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/ThresholdMD.cpp
@@ -34,10 +34,10 @@ ThresholdMD::~ThresholdMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string ThresholdMD::name() const { return "ThresholdMD"; };
+const std::string ThresholdMD::name() const { return "ThresholdMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int ThresholdMD::version() const { return 1; };
+int ThresholdMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string ThresholdMD::category() const { return "MDAlgorithms"; }
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/TransformMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/TransformMD.cpp
index b75054a639aed6fc40318ea50d68499b77d70592..72480fa92253c6b91351ba1093bbb65702c6cc66 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/TransformMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/TransformMD.cpp
@@ -29,10 +29,10 @@ TransformMD::~TransformMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string TransformMD::name() const { return "TransformMD"; };
+const std::string TransformMD::name() const { return "TransformMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int TransformMD::version() const { return 1; };
+int TransformMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string TransformMD::category() const { return "MDAlgorithms"; }
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/UnaryOperationMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/UnaryOperationMD.cpp
index 577698cc709bc45e3bd316441a371da87c783c3f..cf04da6df00755ce518c61ba897fcb95e827d910 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/UnaryOperationMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/UnaryOperationMD.cpp
@@ -25,10 +25,10 @@ UnaryOperationMD::~UnaryOperationMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string UnaryOperationMD::name() const { return "UnaryOperationMD"; };
+const std::string UnaryOperationMD::name() const { return "UnaryOperationMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int UnaryOperationMD::version() const { return 1; };
+int UnaryOperationMD::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string UnaryOperationMD::category() const {
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/UnitsConversionHelper.cpp b/Code/Mantid/Framework/MDAlgorithms/src/UnitsConversionHelper.cpp
index 8b8f777e1ab7cc12f3759563cc9700c67b714df6..442c2416a54419096a9d21483f0fd81876eff5ff 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/UnitsConversionHelper.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/UnitsConversionHelper.cpp
@@ -366,7 +366,7 @@ UnitsConversionHelper::UnitsConversionHelper()
     : m_UnitCnvrsn(CnvrtToMD::ConvertNo), m_Factor(1), m_Power(1),
       m_Emode(-1), // undefined
       m_L1(1), m_Efix(1), m_TwoTheta(0), m_L2(1), m_pTwoThetas(NULL),
-      m_pL2s(NULL), m_pEfixedArray(NULL){};
+      m_pL2s(NULL), m_pEfixedArray(NULL){}
 
 } // endNamespace DataObjects
 } // endNamespace Mantid
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/UserFunctionMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/UserFunctionMD.cpp
index a75536b4f4063b4878aa54e8a815339dd1df6b26..85c8cef79f22c666a5214e64969e1c693801f6e6 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/UserFunctionMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/UserFunctionMD.cpp
@@ -11,7 +11,7 @@ namespace Mantid {
 namespace MDAlgorithms {
 
 // Subscribe the function into the factory.
-DECLARE_FUNCTION(UserFunctionMD);
+DECLARE_FUNCTION(UserFunctionMD)
 
 /// Default constructor
 UserFunctionMD::UserFunctionMD() {
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/XorMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/XorMD.cpp
index d503d3b23cdc53572d53bda95833abce73c4561a..967705a433a46219b4c644d9b64190816960fc51 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/XorMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/XorMD.cpp
@@ -22,10 +22,10 @@ XorMD::~XorMD() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string XorMD::name() const { return "XorMD"; };
+const std::string XorMD::name() const { return "XorMD"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int XorMD::version() const { return 1; };
+int XorMD::version() const { return 1; }
 
 //----------------------------------------------------------------------------------------------
 /// Run the algorithm with a MDHisotWorkspace as output and operand
diff --git a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunction1DAdapter.h b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunction1DAdapter.h
index f8eb459d600f591555f931c0e3d5cbf711b720e8..4dfd15fa59522fa1ea6e053695784ab31a84fb32 100644
--- a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunction1DAdapter.h
+++ b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunction1DAdapter.h
@@ -62,8 +62,8 @@ public:
 
 private:
   /// The PyObject must be supplied to construct the object
-  DISABLE_DEFAULT_CONSTRUCT(IFunction1DAdapter);
-  DISABLE_COPY_AND_ASSIGN(IFunction1DAdapter);
+  DISABLE_DEFAULT_CONSTRUCT(IFunction1DAdapter)
+  DISABLE_COPY_AND_ASSIGN(IFunction1DAdapter)
 
   /// Flag if the functionDeriv1D method is overridden (avoids multiple checks)
   bool m_derivOveridden;
diff --git a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunctionAdapter.h b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunctionAdapter.h
index 791e261ac94a171674566958a64aa445ecca14b8..30479217d156ce155cd019e22bcc89b07082a1da 100644
--- a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunctionAdapter.h
+++ b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunctionAdapter.h
@@ -106,8 +106,8 @@ protected:
 
 private:
   /// The PyObject must be supplied to construct the object
-  DISABLE_DEFAULT_CONSTRUCT(IFunctionAdapter);
-  DISABLE_COPY_AND_ASSIGN(IFunctionAdapter);
+  DISABLE_DEFAULT_CONSTRUCT(IFunctionAdapter)
+  DISABLE_COPY_AND_ASSIGN(IFunctionAdapter)
 
   /// The name of the function
   std::string m_name;
diff --git a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IPeakFunctionAdapter.h b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IPeakFunctionAdapter.h
index 73a5d5a485bc1f7f300403975a0abd726b50176c..a9e32e733de2b29d86df618c6b15306b16d5ce0a 100644
--- a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IPeakFunctionAdapter.h
+++ b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IPeakFunctionAdapter.h
@@ -87,8 +87,8 @@ public:
 
 private:
   /// The PyObject must be supplied to construct the object
-  DISABLE_DEFAULT_CONSTRUCT(IPeakFunctionAdapter);
-  DISABLE_COPY_AND_ASSIGN(IPeakFunctionAdapter);
+  DISABLE_DEFAULT_CONSTRUCT(IPeakFunctionAdapter)
+  DISABLE_COPY_AND_ASSIGN(IPeakFunctionAdapter)
 };
 }
 }
diff --git a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/AlgorithmAdapter.h b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/AlgorithmAdapter.h
index 8da49cf8c2fc6d5e36cfabdeb2656e0ad5e0104e..4ff4e6147e7179cdba497844e0f64cc30ebfe276 100644
--- a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/AlgorithmAdapter.h
+++ b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/AlgorithmAdapter.h
@@ -123,8 +123,8 @@ protected:
 
 private:
   /// The PyObject must be supplied to construct the object
-  DISABLE_DEFAULT_CONSTRUCT(AlgorithmAdapter);
-  DISABLE_COPY_AND_ASSIGN(AlgorithmAdapter);
+  DISABLE_DEFAULT_CONSTRUCT(AlgorithmAdapter)
+  DISABLE_COPY_AND_ASSIGN(AlgorithmAdapter)
 
   /// Private init for this algorithm
   virtual void init();
diff --git a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/DataProcessorAdapter.h b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/DataProcessorAdapter.h
index f635b0bd465177fc75ed99ff0fbd1fda3897263a..56d0093b0a8e2e7f1ee1ee3c8ff1fe40399a32aa 100644
--- a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/DataProcessorAdapter.h
+++ b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/DataProcessorAdapter.h
@@ -100,8 +100,8 @@ public:
 
 private:
   /// The PyObject must be supplied to construct the object
-  DISABLE_DEFAULT_CONSTRUCT(DataProcessorAdapter);
-  DISABLE_COPY_AND_ASSIGN(DataProcessorAdapter);
+  DISABLE_DEFAULT_CONSTRUCT(DataProcessorAdapter)
+  DISABLE_COPY_AND_ASSIGN(DataProcessorAdapter)
 };
 }
 }
diff --git a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/kernel/Converters/NumpyFunctions.h b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/kernel/Converters/NumpyFunctions.h
new file mode 100644
index 0000000000000000000000000000000000000000..473189403f991563d30440d500a2c302104226a7
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/kernel/Converters/NumpyFunctions.h
@@ -0,0 +1,56 @@
+#ifndef NUMPY_FUNCTIONS_H
+#define NUMPY_FUNCTIONS_H
+/*
+  Copyright &copy; 2011 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>.
+  Code Documentation is available at: <http://doxygen.mantidproject.org>
+*/
+#ifdef __GNUC__
+#pragma GCC system_header
+#endif
+
+#include <boost/python/list.hpp>
+#include "MantidKernel/WarningSuppressions.h"
+GCC_DIAG_OFF(cast - qual)
+// See
+// http://docs.scipy.org/doc/numpy/reference/c-api.array.html#PY_ARRAY_UNIQUE_SYMBOL
+#define PY_ARRAY_UNIQUE_SYMBOL KERNEL_ARRAY_API
+#define NO_IMPORT_ARRAY
+#include <numpy/arrayobject.h>
+GCC_DIAG_ON(cast - qual)
+
+/**functions containing numpy macros. We put them in a separate header file to
+  *suppress the warning
+  *ISO C++ forbids casting between pointer-to-function and pointer-to-object
+  */
+namespace Mantid {
+namespace PythonInterface {
+namespace Converters {
+namespace Impl {
+/// equivalent to macro PyArray_IterNew
+PyObject *func_PyArray_IterNew(PyArrayObject *arr);
+/// equivalent to macro PyArray_NewFromDescr
+PyArrayObject *func_PyArray_NewFromDescr(int datatype, const int ndims,
+                                         Py_intptr_t *dims);
+}
+}
+}
+}
+#endif // NUMPY_FUNCTIONS_H
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp
index 71dd4571e3213c1a41e66e795a667e290ec0f9af..99e7e215f5d7f55b1d030bf42a7d644114cda969 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp
@@ -33,9 +33,9 @@ namespace
   typedef void(*declarePropertyType4)(boost::python::object & self, const std::string &, const boost::python::object &, const int);
 
   // Overload types
-  BOOST_PYTHON_FUNCTION_OVERLOADS(declarePropertyType1_Overload, PythonAlgorithm::declarePyAlgProperty, 2, 3);
-  BOOST_PYTHON_FUNCTION_OVERLOADS(declarePropertyType2_Overload, PythonAlgorithm::declarePyAlgProperty, 3, 6);
-  BOOST_PYTHON_FUNCTION_OVERLOADS(declarePropertyType3_Overload, PythonAlgorithm::declarePyAlgProperty, 4, 5);
+  BOOST_PYTHON_FUNCTION_OVERLOADS(declarePropertyType1_Overload, PythonAlgorithm::declarePyAlgProperty, 2, 3)
+  BOOST_PYTHON_FUNCTION_OVERLOADS(declarePropertyType2_Overload, PythonAlgorithm::declarePyAlgProperty, 3, 6)
+  BOOST_PYTHON_FUNCTION_OVERLOADS(declarePropertyType3_Overload, PythonAlgorithm::declarePyAlgProperty, 4, 5)
 }
 
 void export_leaf_classes()
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp
index 12bfc84afbc68a1900b0a1214a4e3ef48a9e81fd..4719f8e959126fdb9aa392704adc0518d41a8b3d 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp
@@ -97,7 +97,7 @@ GCC_DIAG_OFF(cast-qual)
     FileLoaderRegistry::Instance().unsubscribe(descr.first, descr.second);
   }
 
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(existsOverloader, exists, 1, 2);
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(existsOverloader, exists, 1, 2)
 
   ///@endcond
 }
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp
index d44c0a1f606327a92cf20adb9a64e7392fff9922..4296086b4f68f950c5e8326dd0de2d9bf6a57914 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp
@@ -59,8 +59,8 @@ namespace
   ///@cond
   //------------------------------------------------------------------------------------------------------
   /// Define overload generators
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(create_overloads,AlgorithmManagerImpl::create, 1,2);
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createUnmanaged_overloads,AlgorithmManagerImpl::createUnmanaged, 1,2);
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(create_overloads,AlgorithmManagerImpl::create, 1,2)
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createUnmanaged_overloads,AlgorithmManagerImpl::createUnmanaged, 1,2)
   ///@endcond
 }
 
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp
index 0a1e917bd120a1ad8aabd2b97e582f008116c595..4151bcbebf843e22591789803a3f9136041fc14e 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp
@@ -27,7 +27,7 @@ namespace
 
   //------------------------------- Overload macros ---------------------------
   // Overloads for operator() function which has 1 optional argument
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Axis_getValue, Axis::getValue, 1, 2);
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Axis_getValue, Axis::getValue, 1, 2)
 
   /**
    * Extract the axis values as a sequence. A numpy array is used if the
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ExperimentInfo.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ExperimentInfo.cpp
index 4f784af07eae140aff25064204561875e5cb6ba2..b02c444f40f44c630a6a4e48363a50a87983f78d 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ExperimentInfo.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ExperimentInfo.cpp
@@ -11,7 +11,7 @@ using Mantid::PythonInterface::Policies::RemoveConstSharedPtr;
 using namespace boost::python;
 
 /// Overload generator for getInstrumentFilename
-BOOST_PYTHON_FUNCTION_OVERLOADS(getInstrumentFilename_Overload, ExperimentInfo::getInstrumentFilename, 1, 2);
+BOOST_PYTHON_FUNCTION_OVERLOADS(getInstrumentFilename_Overload, ExperimentInfo::getInstrumentFilename, 1, 2)
 
 void export_ExperimentInfo()
 {
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp
index 0ff7f80e71ef6ad9a7eee5d5e28cd070068a40f9..d4bec6851b00d0549be757ae4136600725e18278 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp
@@ -8,7 +8,7 @@ using Mantid::API::FileFinderImpl;
 using namespace boost::python;
 
 namespace {
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getFullPathOverloader, getFullPath, 1, 2);
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getFullPathOverloader, getFullPath, 1, 2)
 }
 
 void export_FileFinder()
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp
index caa28aea2a08327eefdfff4d5014de8cea77b281..d43ac0538b798e6bf3bf5978e8e9af36a0e3d391 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp
@@ -35,10 +35,10 @@ namespace
   // -- Set property overloads --
   // setProperty(index,value,explicit)
   typedef void(IFunction::*setParameterType1)(size_t,const double & value,bool);
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(setParameterType1_Overloads, setParameter, 2, 3);
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(setParameterType1_Overloads, setParameter, 2, 3)
   // setProperty(index,value,explicit)
   typedef void(IFunction::*setParameterType2)(const std::string &,const double & value,bool);
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(setParameterType2_Overloads, setParameter, 2, 3);
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(setParameterType2_Overloads, setParameter, 2, 3)
 
 
   ///@endcond
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp
index 6ec0dcda804db20c630a039e12d8c73d1ff0e7b1..11dd4f9b8bff6891cb963f523178ba945c98c2b5 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp
@@ -13,7 +13,7 @@ using namespace boost::python;
 namespace
 {
   ///@cond
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Workspace_isDirtyOverloads, Workspace::isDirty, 0, 1);
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Workspace_isDirtyOverloads, Workspace::isDirty, 0, 1)
   ///@endcond
 }
 
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp
index 6ff101d8dddd7456ad557193dd45a01f75080b53..e7cc6802b0fa5033923d65d5a65afe00c161053b 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp
@@ -34,9 +34,9 @@ namespace
   }
 
   /// Overload generator for create
-  BOOST_PYTHON_FUNCTION_OVERLOADS(createFromParent_Overload, createFromParentPtr, 2, 5);
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createTable_Overload, createTable, 0, 1);
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createPeaks_Overload, createPeaks, 0, 1);
+  BOOST_PYTHON_FUNCTION_OVERLOADS(createFromParent_Overload, createFromParentPtr, 2, 5)
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createTable_Overload, createTable, 0, 1)
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createPeaks_Overload, createPeaks, 0, 1)
 }
 
 void export_WorkspaceFactory()
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Component.cpp b/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Component.cpp
index 406a438bcb3df8e5e49006ceec9a7cb9e7fd840d..02856d5765b992fc759ed31b96ea8768567ed06d 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Component.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Component.cpp
@@ -9,15 +9,15 @@ using namespace boost::python;
 namespace
 {
   // Default parameter function overloads
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getParameterNames,Component::getParameterNames,0,1);
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_hasParameter,Component::hasParameter,1,2);
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getNumberParameter,Component::getNumberParameter,1,2);
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getBoolParameter,Component::getBoolParameter,1,2);
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getPositionParameter,Component::getPositionParameter,1,2);
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getRotationParameter,Component::getRotationParameter,1,2);
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getStringParameter,Component::getStringParameter,1,2);
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getIntParameter,Component::getIntParameter,1,2);
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getParameterType,Component::getParameterType,1,2);
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getParameterNames,Component::getParameterNames,0,1)
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_hasParameter,Component::hasParameter,1,2)
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getNumberParameter,Component::getNumberParameter,1,2)
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getBoolParameter,Component::getBoolParameter,1,2)
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getPositionParameter,Component::getPositionParameter,1,2)
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getRotationParameter,Component::getRotationParameter,1,2)
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getStringParameter,Component::getStringParameter,1,2)
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getIntParameter,Component::getIntParameter,1,2)
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getParameterType,Component::getParameterType,1,2)
 
 
 }
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Goniometer.cpp b/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Goniometer.cpp
index 16bcc7cf7b1918846db178a0e7cb3cd26ad64f04..74b37cfebead2690565ab953180431d4bc3ec39c 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Goniometer.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Goniometer.cpp
@@ -14,7 +14,7 @@ namespace //<unnamed>
 {
   ///@cond
   // define overloaded functions
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getEulerAngles_overloads, Goniometer::getEulerAngles, 0, 1);
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getEulerAngles_overloads, Goniometer::getEulerAngles, 0, 1)
   ///@endcond
 
   /// Set the U vector via a numpy array
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/CMakeLists.txt b/Code/Mantid/Framework/PythonInterface/mantid/kernel/CMakeLists.txt
index 32975fce4226f3b7a7ac09dca016e6070120b638..02058243e4c2a308c227eebf75ec25646685c597 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/CMakeLists.txt
+++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/CMakeLists.txt
@@ -54,6 +54,7 @@ set ( SRC_FILES
   src/Converters/CloneToNumpy.cpp
   src/Converters/NDArrayToVector.cpp
   src/Converters/NDArrayTypeIndex.cpp
+  src/Converters/NumpyFunctions.cpp
   src/Converters/PyArrayType.cpp
   src/Converters/PyObjectToMatrix.cpp
   src/Converters/PyObjectToV3D.cpp
@@ -71,6 +72,7 @@ set ( SRC_FILES
 set ( INC_FILES
   ${HEADER_DIR}/kernel/Converters/CArrayToNDArray.h
   ${HEADER_DIR}/kernel/Converters/MatrixToNDArray.h
+  ${HEADER_DIR}/kernel/Converters/NumpyFunctions.h
   ${HEADER_DIR}/kernel/Converters/NDArrayToVector.h
   ${HEADER_DIR}/kernel/Converters/NDArrayTypeIndex.h
   ${HEADER_DIR}/kernel/Converters/WrapWithNumpy.h
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp
index 6213ffb71c9efddf16c8060a5b115367bbce7565..55534dbc1cc8b4409c38d454c38e994a5dbe28c7 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp
@@ -3,14 +3,7 @@
 //-----------------------------------------------------------------------------
 #include "MantidPythonInterface/kernel/Converters/CloneToNumpy.h"
 #include "MantidPythonInterface/kernel/Converters/NDArrayTypeIndex.h"
-#include "MantidKernel/WarningSuppressions.h"
-#include <boost/python/list.hpp>
-
-GCC_DIAG_OFF(cast-qual)
-#define PY_ARRAY_UNIQUE_SYMBOL KERNEL_ARRAY_API
-#define NO_IMPORT_ARRAY
-#include <numpy/arrayobject.h>
-GCC_DIAG_ON(cast-qual)
+#include "MantidPythonInterface/kernel/Converters/NumpyFunctions.h"
 
 #include <string>
 
@@ -44,13 +37,9 @@ namespace Mantid { namespace PythonInterface
       {
         Py_intptr_t dims[1] = { static_cast<int>(cvector.size()) };
         int datatype = NDArrayTypeIndex<bool>::typenum;
-        PyArrayObject *nparray = (PyArrayObject*)
-          PyArray_NewFromDescr(&PyArray_Type,
-                               PyArray_DescrFromType(datatype),
-                               1, // rank
-                               dims, // Length in each dimension
-                               NULL, NULL,
-                               0, NULL);
+        PyArrayObject *nparray =
+            func_PyArray_NewFromDescr(datatype, 1, &dims[0]);
+
         for(Py_intptr_t i = 0; i < dims[0]; ++i)
         {
           void *itemPtr = PyArray_GETPTR1(nparray, i);
@@ -71,13 +60,8 @@ namespace Mantid { namespace PythonInterface
       PyObject *cloneND(const ElementType * carray, const int ndims, Py_intptr_t *dims)
       {
         int datatype = NDArrayTypeIndex<ElementType>::typenum;
-        PyArrayObject *nparray = (PyArrayObject*)
-          PyArray_NewFromDescr(&PyArray_Type,
-                               PyArray_DescrFromType(datatype),
-                               ndims, // rank
-                               dims, // Length in each dimension
-                               NULL, NULL,
-                               0, NULL);
+        PyArrayObject *nparray =
+            func_PyArray_NewFromDescr(datatype, ndims, &dims[0]);
         // Compute total number of elements
         size_t length(dims[0]);
         if(ndims > 1)
@@ -133,18 +117,18 @@ namespace Mantid { namespace PythonInterface
         INSTANTIATE_CLONEND(ElementType)
 
       ///@cond Doxygen doesn't seem to like this...
-      INSTANTIATE_CLONE(int);
-      INSTANTIATE_CLONE(long);
-      INSTANTIATE_CLONE(long long);
-      INSTANTIATE_CLONE(unsigned int);
-      INSTANTIATE_CLONE(unsigned long);
-      INSTANTIATE_CLONE(unsigned long long);
-      INSTANTIATE_CLONE(double);
-      INSTANTIATE_CLONE(float);
+      INSTANTIATE_CLONE(int)
+      INSTANTIATE_CLONE(long)
+      INSTANTIATE_CLONE(long long)
+      INSTANTIATE_CLONE(unsigned int)
+      INSTANTIATE_CLONE(unsigned long)
+      INSTANTIATE_CLONE(unsigned long long)
+      INSTANTIATE_CLONE(double)
+      INSTANTIATE_CLONE(float)
       // Need further 1D specialisation for string
       INSTANTIATE_CLONE1D(std::string)
       // Need further ND specialisation for bool
-      INSTANTIATE_CLONEND(bool);
+      INSTANTIATE_CLONEND(bool)
       ///@endcond
     }
   }
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp
index 8151c09da2f91a52f7326c8128e540da49bf07ce..98324f55d71d656602c8596399e959fdce10ba88 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp
@@ -4,11 +4,7 @@
 #include "MantidPythonInterface/kernel/Converters/NDArrayToVector.h"
 #include "MantidPythonInterface/kernel/Converters/NDArrayTypeIndex.h"
 #include <boost/python/extract.hpp>
-
-// See http://docs.scipy.org/doc/numpy/reference/c-api.array.html#PY_ARRAY_UNIQUE_SYMBOL
-#define PY_ARRAY_UNIQUE_SYMBOL KERNEL_ARRAY_API
-#define NO_IMPORT_ARRAY
-#include <numpy/arrayobject.h>
+#include "MantidPythonInterface/kernel/Converters/NumpyFunctions.h"
 
 namespace Mantid
 {
@@ -30,16 +26,20 @@ namespace Mantid
         {
           // Use the iterator API to iterate through the array
           // and assign each value to the corresponding vector
-          PyObject *iter = PyArray_IterNew((PyObject*)arr);
+          typedef union {
+            DestElementType* output;
+            void *input;
+          } npy_union;
+          npy_union data;
+          PyObject *iter = Converters::Impl::func_PyArray_IterNew(arr);
           npy_intp index(0);
           do
           {
-            DestElementType *data = (DestElementType*)PyArray_ITER_DATA(iter);
-            cvector[index] = *data;
+            data.input = PyArray_ITER_DATA(iter);
+            cvector[index] = *data.output;
             ++index;
             PyArray_ITER_NEXT(iter);
-          }
-          while(PyArray_ITER_NOTDONE(iter));
+          } while (PyArray_ITER_NOTDONE(iter));
         }
       };
 
@@ -163,15 +163,15 @@ namespace Mantid
         template DLLExport struct NDArrayToVector<ElementType>;
 
       ///@cond Doxygen doesn't seem to like this...
-      INSTANTIATE_TOVECTOR(int);
-      INSTANTIATE_TOVECTOR(long);
-      INSTANTIATE_TOVECTOR(long long);
-      INSTANTIATE_TOVECTOR(unsigned int);
-      INSTANTIATE_TOVECTOR(unsigned long);
-      INSTANTIATE_TOVECTOR(unsigned long long);
-      INSTANTIATE_TOVECTOR(double);
-      INSTANTIATE_TOVECTOR(bool);
-      INSTANTIATE_TOVECTOR(std::string); 
+      INSTANTIATE_TOVECTOR(int)
+      INSTANTIATE_TOVECTOR(long)
+      INSTANTIATE_TOVECTOR(long long)
+      INSTANTIATE_TOVECTOR(unsigned int)
+      INSTANTIATE_TOVECTOR(unsigned long)
+      INSTANTIATE_TOVECTOR(unsigned long long)
+      INSTANTIATE_TOVECTOR(double)
+      INSTANTIATE_TOVECTOR(bool)
+      INSTANTIATE_TOVECTOR(std::string)
       ///@endcond
     }
   }
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayTypeIndex.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayTypeIndex.cpp
index a1efd28e193cad6e6512bea77ae6157f510806bd..5a7981231fa947acebb8cd983bd8b73b630b7082 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayTypeIndex.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayTypeIndex.cpp
@@ -24,15 +24,15 @@ namespace Mantid
         template DLLExport struct NDArrayTypeIndex<CType>;\
 
 
-      DEFINE_TYPE_MAPPING(int, NPY_INT);
-      DEFINE_TYPE_MAPPING(long, NPY_LONG);
-      DEFINE_TYPE_MAPPING(long long, NPY_LONGLONG);
-      DEFINE_TYPE_MAPPING(unsigned int, NPY_UINT);
-      DEFINE_TYPE_MAPPING(unsigned long, NPY_ULONG);
-      DEFINE_TYPE_MAPPING(unsigned long long, NPY_ULONGLONG);
-      DEFINE_TYPE_MAPPING(bool, NPY_BOOL);
-      DEFINE_TYPE_MAPPING(double, NPY_DOUBLE);
-      DEFINE_TYPE_MAPPING(float, NPY_FLOAT);
+      DEFINE_TYPE_MAPPING(int, NPY_INT)
+      DEFINE_TYPE_MAPPING(long, NPY_LONG)
+      DEFINE_TYPE_MAPPING(long long, NPY_LONGLONG)
+      DEFINE_TYPE_MAPPING(unsigned int, NPY_UINT)
+      DEFINE_TYPE_MAPPING(unsigned long, NPY_ULONG)
+      DEFINE_TYPE_MAPPING(unsigned long long, NPY_ULONGLONG)
+      DEFINE_TYPE_MAPPING(bool, NPY_BOOL)
+      DEFINE_TYPE_MAPPING(double, NPY_DOUBLE)
+      DEFINE_TYPE_MAPPING(float, NPY_FLOAT)
     }
   }
 }
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NumpyFunctions.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NumpyFunctions.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5696352a6cacb38cdb90e5ff7b5e0a487572301c
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NumpyFunctions.cpp
@@ -0,0 +1,22 @@
+#include "MantidPythonInterface/kernel/Converters/NumpyFunctions.h"
+
+namespace Mantid {
+namespace PythonInterface {
+namespace Converters {
+namespace Impl {
+
+PyObject *func_PyArray_IterNew(PyArrayObject *arr) {
+  return PyArray_IterNew((PyObject *)arr);
+}
+
+PyArrayObject *func_PyArray_NewFromDescr(int datatype, const int ndims,
+                                         Py_intptr_t *dims) {
+  return (PyArrayObject *)PyArray_NewFromDescr(
+      &PyArray_Type, PyArray_DescrFromType(datatype), ndims, // rank
+      dims, // Length in each dimension
+      NULL, NULL, 0, NULL);
+}
+}
+}
+}
+}
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/WrapWithNumpy.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/WrapWithNumpy.cpp
index d353890b416dd59e13b296e6144bed28f29bbbb4..8b56c8eb7a17f623ded38b8000850ba2781c6c16 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/WrapWithNumpy.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/WrapWithNumpy.cpp
@@ -65,14 +65,14 @@ namespace Mantid { namespace PythonInterface
         template DLLExport PyObject *wrapWithNDArray<ElementType>(const ElementType*, const int ndims, Py_intptr_t *dims, const NumpyWrapMode);
 
       ///@cond Doxygen doesn't seem to like this...
-      INSTANTIATE_WRAPNUMPY(int);
-      INSTANTIATE_WRAPNUMPY(long);
-      INSTANTIATE_WRAPNUMPY(long long);
-      INSTANTIATE_WRAPNUMPY(unsigned int);
-      INSTANTIATE_WRAPNUMPY(unsigned long);
-      INSTANTIATE_WRAPNUMPY(unsigned long long);
-      INSTANTIATE_WRAPNUMPY(double);
-      INSTANTIATE_WRAPNUMPY(float);
+      INSTANTIATE_WRAPNUMPY(int)
+      INSTANTIATE_WRAPNUMPY(long)
+      INSTANTIATE_WRAPNUMPY(long long)
+      INSTANTIATE_WRAPNUMPY(unsigned int)
+      INSTANTIATE_WRAPNUMPY(unsigned long)
+      INSTANTIATE_WRAPNUMPY(unsigned long long)
+      INSTANTIATE_WRAPNUMPY(double)
+      INSTANTIATE_WRAPNUMPY(float)
       ///@endcond
     }
   }
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/ConfigService.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/ConfigService.cpp
index 762f446435d56a3f2bad87ec96e4bccaf5a7481d..45a9d0f8a559794869adc667a6bd9cd94776578f 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/ConfigService.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/ConfigService.cpp
@@ -31,9 +31,9 @@ namespace
    }
 
   /// Overload generator for getInstrument
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getInstrument_Overload, getInstrument, 0, 1);
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getInstrument_Overload, getInstrument, 0, 1)
   /// Overload generator for getString
-  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getString_Overload, getString, 1, 2);
+  BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getString_Overload, getString, 1, 2)
 }
 
 void export_ConfigService()
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/Statistics.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/Statistics.cpp
index 8fc7a039ebfccf5490771a26128961bec9504395..3bfa9244083a18adb81d5a276d1f037ac23bf52d 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/Statistics.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/Statistics.cpp
@@ -94,7 +94,7 @@ namespace
     }
   }
   // Define an overload to handle the default argument
-  BOOST_PYTHON_FUNCTION_OVERLOADS(getStatisticsOverloads, getStatisticsNumpy, 1, 2);
+  BOOST_PYTHON_FUNCTION_OVERLOADS(getStatisticsOverloads, getStatisticsNumpy, 1, 2)
 
   //============================ Z score ============================================
   // Function pointer to real implementation of Zscore functions
@@ -132,7 +132,7 @@ namespace
     return getZScoreNumpyImpl(&getZscore, data, sorted);
   }
   // Define an overload to handle the default argument
-  BOOST_PYTHON_FUNCTION_OVERLOADS(getZscoreOverloads, getZscoreNumpy, 1, 2);
+  BOOST_PYTHON_FUNCTION_OVERLOADS(getZscoreOverloads, getZscoreNumpy, 1, 2)
 
   /**
    * Proxy for @see Mantid::Kernel::getModifiedZscore so that it can accept numpy arrays,
@@ -143,7 +143,7 @@ namespace
     return getZScoreNumpyImpl(&getModifiedZscore, data, sorted);
   }
   // Define an overload to handle the default argument
-  BOOST_PYTHON_FUNCTION_OVERLOADS(getModifiedZscoreOverloads, getModifiedZscoreNumpy, 1, 2);
+  BOOST_PYTHON_FUNCTION_OVERLOADS(getModifiedZscoreOverloads, getModifiedZscoreNumpy, 1, 2)
 
 
   //============================ getMoments ============================================
@@ -194,7 +194,7 @@ namespace
   }
 
   // Define an overload to handle the default argument
-  BOOST_PYTHON_FUNCTION_OVERLOADS(getMomentsAboutOriginOverloads, getMomentsAboutOriginNumpy, 2, 3);
+  BOOST_PYTHON_FUNCTION_OVERLOADS(getMomentsAboutOriginOverloads, getMomentsAboutOriginNumpy, 2, 3)
 
   /**
    * Proxy for @see Mantid::Kernel::getMomentsAboutMean so that it can accept numpy arrays
@@ -207,7 +207,7 @@ namespace
   }
 
   // Define an overload to handle the default argument
-  BOOST_PYTHON_FUNCTION_OVERLOADS(getMomentsAboutMeanOverloads, getMomentsAboutMeanNumpy, 2, 3);
+  BOOST_PYTHON_FUNCTION_OVERLOADS(getMomentsAboutMeanOverloads, getMomentsAboutMeanNumpy, 2, 3)
   ///@endcond
 }
 
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/TimeSeriesProperty.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/TimeSeriesProperty.cpp
index 0934388431327414d8b523c38c9edb853e63b872..2f9bf530009231a934726719b8dbaad4acd44bf5 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/TimeSeriesProperty.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/TimeSeriesProperty.cpp
@@ -38,7 +38,6 @@ namespace
       .def("getStatistics", &TimeSeriesProperty<TYPE>::getStatistics) \
       .def("timeAverageValue", &TimeSeriesProperty<TYPE>::timeAverageValue) \
       ;
-  ;
 }
 
 void export_TimeSeriesProperty_Double()
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Registry/SequenceTypeHandler.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Registry/SequenceTypeHandler.cpp
index 067aa64fc4d24d7f9fcbe749edcfad9faf257e14..627bc2d4cd003f5afc9e907616619daf8c69f931 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Registry/SequenceTypeHandler.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Registry/SequenceTypeHandler.cpp
@@ -128,15 +128,15 @@ namespace Mantid
       #define INSTANTIATE(ElementType)\
         template DLLExport struct SequenceTypeHandler<std::vector<ElementType> >;
 
-      INSTANTIATE(int);
-      INSTANTIATE(long);
-      INSTANTIATE(long long);
-      INSTANTIATE(unsigned int);
-      INSTANTIATE(unsigned long);
-      INSTANTIATE(unsigned long long);
-      INSTANTIATE(double);
-      INSTANTIATE(std::string);
-      INSTANTIATE(bool);
+      INSTANTIATE(int)
+      INSTANTIATE(long)
+      INSTANTIATE(long long)
+      INSTANTIATE(unsigned int)
+      INSTANTIATE(unsigned long)
+      INSTANTIATE(unsigned long long)
+      INSTANTIATE(double)
+      INSTANTIATE(std::string)
+      INSTANTIATE(bool)
       ///@endcond
     }
   }
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadDNSLegacy.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadDNSLegacy.py
new file mode 100644
index 0000000000000000000000000000000000000000..62b8cc71d145baab36164ae0dd180e608fa212be
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadDNSLegacy.py
@@ -0,0 +1,98 @@
+from mantid.kernel import *
+from mantid.api import *
+import mantid.simpleapi as api
+import numpy as np
+
+import os, sys
+
+sys.path.insert(0, os.path.dirname(__file__))
+from dnsdata import DNSdata
+sys.path.pop(0)
+
+class LoadDNSLegacy(PythonAlgorithm):
+    """
+    Load the DNS Legacy data file to the mantid workspace
+    """
+    def category(self):
+        """
+        Returns categore
+        """
+        return 'DataHandling'
+
+    def name(self):
+        """
+        Returns name
+        """
+        return "LoadDNSLegacy"
+
+    def summary(self):
+        return "Load the DNS Legacy data file to the mantid workspace."
+
+    def PyInit(self):
+        self.declareProperty(FileProperty("Filename", "",  \
+                FileAction.Load, ['.d_dat']), \
+                "Name of DNS experimental data file.")
+        self.declareProperty(WorkspaceProperty("OutputWorkspace", \
+                "", direction=Direction.Output), \
+                doc="Name of the workspace to store the experimental data.")
+
+        return
+
+
+    def PyExec(self):
+        # Input
+        filename = self.getPropertyValue("Filename")
+        outws = self.getPropertyValue("OutputWorkspace")
+
+        # load data array from the given file
+        data_array = np.loadtxt(filename)
+        ndet = 24
+        dataX = np.zeros(ndet)
+        dataY = data_array[0:ndet, 1:]
+        dataE = np.sqrt(dataY)
+        # create workspace
+        __temporary_workspace__ = api.CreateWorkspace(DataX=dataX, \
+                DataY=dataY, DataE=dataE, NSpec=ndet, UnitX="Wavelength")
+        api.LoadInstrument(__temporary_workspace__, InstrumentName='DNS')
+
+        # load run information
+        metadata = DNSdata()
+        metadata.read_legacy(filename)
+        run = __temporary_workspace__.mutableRun()
+        run.setStartAndEndTime(DateAndTime(metadata.start_time), \
+                DateAndTime(metadata.end_time))
+
+        # rotate the detector bank to the proper position
+        api.RotateInstrumentComponent(__temporary_workspace__, \
+                "bank0", X=0, Y=1, Z=0, Angle=metadata.deterota)
+        # add sample log Ei
+        energy = get_energy(metadata.wavelength)
+        api.AddSampleLog(__temporary_workspace__, \
+                'Ei', LogText=str(energy), LogType='Number')
+        # add other sample logs
+        api.AddSampleLog(__temporary_workspace__, 'deterota', \
+                LogText=str(metadata.deterota), LogType='Number')
+        api.AddSampleLog(__temporary_workspace__, 'huber', \
+                LogText=str(metadata.huber), LogType='Number')
+        api.AddSampleLog(__temporary_workspace__, 'T1', \
+                LogText=str(metadata.t1), LogType='Number')
+        api.AddSampleLog(__temporary_workspace__, 'T2', \
+                LogText=str(metadata.t2), LogType='Number')
+        api.AddSampleLog(__temporary_workspace__, 'Tsp', \
+                LogText=str(metadata.tsp), LogType='Number')
+
+        self.setProperty("OutputWorkspace", __temporary_workspace__)
+        self.log().debug('LoadDNSLegacy: OK')
+        api.DeleteWorkspace(__temporary_workspace__)
+
+        return
+
+
+def get_energy(wavelength):
+    """
+    Calculates neutron energy in eV from the given wavelength in Angstrom
+    """
+    return  1e-3*81.73 / wavelength**2
+
+# Register algorithm with Mantid
+AlgorithmFactory.subscribe(LoadDNSLegacy)
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/PoldiCreatePeaksFromFile.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/PoldiCreatePeaksFromFile.py
new file mode 100644
index 0000000000000000000000000000000000000000..d68a14bfb2a65c2fcfcb370d2d4a651e66c59eca
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/PoldiCreatePeaksFromFile.py
@@ -0,0 +1,217 @@
+# pylint: disable=no-init,invalid-name,too-few-public-methods
+from mantid.kernel import *
+from mantid.simpleapi import *
+from mantid.api import *
+from mantid.geometry import *
+
+from pyparsing import *
+
+import os
+
+
+class PoldiCompound(object):
+    """Small helper class to handle the results from PoldiCrystalFileParser."""
+    _name = ""
+    _spacegroup = ""
+    _atomString = ""
+    _cellDict = ""
+
+    def __init__(self, name, elements):
+        self._name = name
+
+        self.assign(elements)
+
+    def assign(self, elements):
+        for c in elements:
+            if c[0] == "atoms":
+                self._atomString = ';'.join(c[1:])
+            elif c[0] == "lattice":
+                cellNames = ['a', 'b', 'c', 'alpha', 'beta', 'gamma']
+                self._cellDict = dict(zip(cellNames, c[1:]))
+            elif c[0] == "spacegroup":
+                self._spacegroup = c[1]
+
+    def getAtomString(self):
+        return self._atomString
+
+    def getCellParameters(self):
+        return self._cellDict
+
+    def getSpaceGroup(self):
+        return self._spacegroup
+
+    def getName(self):
+        return self._name
+
+
+def raiseParseErrorException(message):
+    raise ParseException(message)
+
+
+class PoldiCrystalFileParser(object):
+    """Small parser for crystal structure files used at POLDI
+
+    This class encapsulates a small parser for crystal structure files that are used at
+    POLDI. The files contains information about the lattice, the space group and the basis (atoms
+    in the asymmetric unit).
+
+    The file format is defined as follows:
+
+        Compound_1 {
+            Lattice: [1 - 6 floats] => a, b, c, alpha, beta, gamma
+            Spacegroup: [valid space group symbol]
+            Atoms; {
+                Element x y z [occupancy [U_eq]]
+                Element x y z [occupancy [U_eq]]
+            }
+        }
+
+        Compound_2 {
+            ...
+        }
+
+    The parser returns a list of PoldiCompound objects with the compounds that were found
+    in the file. These are then processed by PoldiCreatePeaksFromFile to generate arguments
+    for calling PoldiCreatePeaksFromCell.
+    """
+    elementSymbol = Word(alphas, min=1, max=2).setFailAction(
+        lambda o, s, loc, token: raiseParseErrorException("Element symbol must be one or two characters."))
+    integerNumber = Word(nums)
+    decimalSeparator = Literal('.')
+    floatNumber = Combine(
+        integerNumber +
+        Optional(decimalSeparator + Optional(integerNumber))
+    )
+
+    whiteSpace = Suppress(White())
+
+    atomLine = Combine(
+        elementSymbol + whiteSpace +
+        delimitedList(floatNumber, delim=White()),
+        joinString=' '
+    )
+
+    keyValueSeparator = Suppress(Literal(":"))
+
+    groupOpener = Suppress(Literal('{'))
+    groupCloser = Suppress(Literal('}'))
+
+    atomsGroup = Group(CaselessLiteral("atoms") + keyValueSeparator +
+                       groupOpener + delimitedList(atomLine, delim=lineEnd) + groupCloser)
+
+    unitCell = Group(CaselessLiteral("lattice") + keyValueSeparator + delimitedList(
+        floatNumber, delim=White()))
+
+    spaceGroup = Group(CaselessLiteral("spacegroup") + keyValueSeparator + Word(
+        alphanums + "-" + ' '))
+
+    compoundContent = Each([atomsGroup, unitCell, spaceGroup]).setFailAction(
+        lambda o, s, loc, token: raiseParseErrorException(
+            "One of 'Lattice', 'SpaceGroup', 'Atoms' is missing or contains errors."))
+
+    compoundName = Word(alphanums + '_')
+
+    compound = Group(compoundName + Optional(whiteSpace) + \
+                     groupOpener + compoundContent + groupCloser)
+
+    comment = Suppress(Literal('#') + restOfLine)
+
+    compounds = Optional(comment) + OneOrMore(compound).ignore(comment) + stringEnd
+
+    def __call__(self, contentString):
+        parsedContent = None
+
+        if os.path.isfile(contentString):
+            parsedContent = self._parseFile(contentString)
+        else:
+            parsedContent = self._parseString(contentString)
+
+        return [PoldiCompound(x[0], x[1:]) for x in parsedContent]
+
+    def _parseFile(self, filename):
+        return self.compounds.parseFile(filename)
+
+    def _parseString(self, stringContent):
+        return self.compounds.parseString(stringContent)
+
+
+class PoldiCreatePeaksFromFile(PythonAlgorithm):
+    _parser = PoldiCrystalFileParser()
+
+    def category(self):
+        return "SINQ\\POLDI"
+
+    def name(self):
+        return "PoldiLoadCrystalData"
+
+    def summary(self):
+        return ("The algorithm reads a POLDI crystal structure file and creates a WorkspaceGroup that contains tables"
+                "with the expected reflections.")
+
+    def PyInit(self):
+        self.declareProperty(
+            FileProperty(name="InputFile",
+                         defaultValue="",
+                         action=FileAction.Load,
+                         extensions=["dat"]),
+            doc="A file with POLDI crystal data.")
+
+        self.declareProperty("LatticeSpacingMin", 0.5,
+                             direction=Direction.Input,
+                             doc="Lowest allowed lattice spacing.")
+
+        self.declareProperty("LatticeSpacingMax", 0.0,
+                             direction=Direction.Input,
+                             doc="Largest allowed lattice spacing.")
+
+        self.declareProperty(
+            WorkspaceProperty(name="OutputWorkspace",
+                              defaultValue="", direction=Direction.Output),
+            doc="WorkspaceGroup with reflection tables.")
+
+
+    def PyExec(self):
+        crystalFileName = self.getProperty("InputFile").value
+        try:
+            # Try parsing the supplied file using PoldiCrystalFileParser
+            compounds = self._parser(crystalFileName)
+
+            dMin = self.getProperty("LatticeSpacingMin").value
+            dMax = self.getProperty("LatticeSpacingMax").value
+
+            workspaces = []
+
+            # Go through found compounds and run "_createPeaksFromCell" for each of them
+            # If two compounds have the same name, a warning is written to the log.
+            for compound in compounds:
+                if compound.getName() in workspaces:
+                    self.log().warning("A compound with the name '" + compound.getName() + \
+                                       "' has already been created. Please check the file '" + crystalFileName + "'")
+                else:
+                    workspaces.append(self._createPeaksFromCell(compound, dMin, dMax))
+
+            self.setProperty("OutputWorkspace", GroupWorkspaces(workspaces))
+
+        # All parse errors are caught here and logged as errors
+        except ParseException as error:
+            errorString = "Could not parse input file '" + crystalFileName + "'.\n"
+            errorString += "The parser reported the following error:\n\t" + str(error)
+
+            self.log().error(errorString)
+
+
+    def _createPeaksFromCell(self, compound, dMin, dMax):
+        if not SpaceGroupFactory.isSubscribedSymbol(compound.getSpaceGroup()):
+            raise RuntimeError("SpaceGroup '" + compound.getSpaceGroup() + "' is not registered.")
+
+        PoldiCreatePeaksFromCell(SpaceGroup=compound.getSpaceGroup(),
+                                 Atoms=compound.getAtomString(),
+                                 LatticeSpacingMin=dMin,
+                                 LatticeSpacingMax=dMax,
+                                 OutputWorkspace=compound.getName(),
+                                 **compound.getCellParameters())
+
+        return compound.getName()
+
+
+AlgorithmFactory.subscribe(PoldiCreatePeaksFromFile)
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/Symmetrise.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/Symmetrise.py
index 3e5ecae529fc9fee4352b5d6c2646fc931bc0f85..563c56c6ccad12148ef4a99896e8c7f7c4a6ac8d 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/Symmetrise.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/Symmetrise.py
@@ -57,9 +57,6 @@ class Symmetrise(PythonAlgorithm):
 
 
     def PyExec(self):
-        from IndirectCommon import StartTime, EndTime
-
-        StartTime('Symmetrise')
         self._setup()
         temp_ws_name = '__symm_temp'
 
@@ -173,8 +170,6 @@ class Symmetrise(PythonAlgorithm):
 
         self.setProperty('OutputWorkspace', self._output_workspace)
 
-        EndTime('Symmetrise')
-
 
     def validateInputs(self):
         """
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py
new file mode 100644
index 0000000000000000000000000000000000000000..d37d518831a02d8268a2b68529381316ec9b503d
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py
@@ -0,0 +1,285 @@
+from mantid.simpleapi import *
+from mantid.api import PythonAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, WorkspaceGroupProperty, \
+                       PropertyMode, MatrixWorkspace
+from mantid.kernel import Direction, logger
+
+
+class ApplyPaalmanPingsCorrection(PythonAlgorithm):
+
+    _sample_ws_name = None
+    _corrections_ws_name = None
+    _use_can = False
+    _can_ws_name = None
+    _use_corrections = False
+    _can_scale_factor = 1.0
+    _scale_can = False
+    _output_ws_name = None
+    _corrections = None
+    _scaled_container = None
+
+
+    def category(self):
+        return "Workflow\\MIDAS;PythonAlgorithms"
+
+
+    def summary(self):
+        return "Applies a calculated absorption correction in the Paalman and Pings factor style."
+
+
+    def PyInit(self):
+        self.declareProperty(MatrixWorkspaceProperty('SampleWorkspace', '',
+                             direction=Direction.Input),
+                             doc='Name for the input Sample workspace.')
+
+        self.declareProperty(WorkspaceGroupProperty('CorrectionsWorkspace', '',
+                             optional=PropertyMode.Optional, direction=Direction.Input),
+                             doc='Name for the input Corrections workspace.')
+
+        self.declareProperty(MatrixWorkspaceProperty('CanWorkspace', '',
+                             optional=PropertyMode.Optional, direction=Direction.Input),
+                             doc='Name for the input Can workspace.')
+
+        self.declareProperty(name='CanScaleFactor', defaultValue=1.0,
+                             doc='Factor to scale the can data')
+
+        self.declareProperty(MatrixWorkspaceProperty('OutputWorkspace', '',
+                             direction=Direction.Output),
+                             doc='The output corrections workspace.')
+
+
+    def PyExec(self):
+        self._setup()
+
+        if not self._use_corrections:
+            logger.information('Not using corrections')
+        if not self._use_can:
+            logger.information('Not using container')
+
+        # Apply container scale factor if needed
+        if self._use_can:
+            if self._scale_can:
+                # Use temp workspace so we don't modify original data
+                Scale(InputWorkspace=self._can_ws_name,
+                      OutputWorkspace=self._scaled_container,
+                      Factor=self._can_scale_factor,
+                      Operation='Multiply')
+                logger.information('Container scaled by %f' % self._can_scale_factor)
+            else:
+                CloneWorkspace(InputWorkspace=self._can_ws_name,
+                               OutputWorkspace=self._scaled_container)
+
+        if self._use_corrections:
+            self._pre_process_corrections()
+
+            if self._use_can:
+                # Use container factors
+                self._correct_sample_can()
+                correction_type = 'sample_and_can_corrections'
+            else:
+                # Use sample factor only
+                self._correct_sample()
+                correction_type = 'sample_corrections_only'
+
+        else:
+            # Do simple subtraction
+            self._subtract()
+            correction_type = 'can_subtraction'
+
+        # Record the container scale factor
+        if self._use_can and self._scale_can:
+            AddSampleLog(Workspace=self._output_ws_name,
+                         LogName='apply_corr_can_scale_factor',
+                         LogType='Number',
+                         LogText=str(self._can_scale_factor))
+
+        # Record the type of corrections applied
+        AddSampleLog(Workspace=self._output_ws_name,
+                     LogName='corrections_type',
+                     LogType='String',
+                     LogText=correction_type)
+
+        self.setPropertyValue('OutputWorkspace', self._output_ws_name)
+
+        # Remove temporary workspaces
+        if self._corrections in mtd:
+            DeleteWorkspace(self._corrections)
+        if self._scaled_container in mtd:
+            DeleteWorkspace(self._scaled_container)
+
+
+    def validateInputs(self):
+        """
+        Validate user input.
+        """
+
+        self._setup()
+        issues = dict()
+
+        # Need something to get corrections from
+        if not (self._use_can or self._use_corrections):
+            error_msg = 'Must provide either CorrectionsWorkspace or CanWorkspace or both'
+            issues['CorrectionsWorkspace'] = error_msg
+            issues['CanWorkspace'] = error_msg
+
+        sample_ws = mtd[self._sample_ws_name]
+        if isinstance(sample_ws, MatrixWorkspace):
+            sample_unit_id = sample_ws.getAxis(0).getUnit().unitID()
+
+            # Check sample and container X axis units match
+            if self._use_can:
+                can_ws = mtd[self._can_ws_name]
+                if isinstance(can_ws, MatrixWorkspace):
+                    can_unit_id = can_ws.getAxis(0).getUnit().unitID()
+                    if can_unit_id != sample_unit_id:
+                        issues['CanWorkspace'] = 'X axis unit must match SampleWorkspace'
+                else:
+                    issues['CanWorkspace'] = 'Must be a MatrixWorkspace'
+        else:
+            issues['SampleWorkspace'] = 'Must be a MatrixWorkspace'
+
+        return issues
+
+
+    def _setup(self):
+        """
+        Get properties and setup instance variables.
+        """
+
+        self._sample_ws_name = self.getPropertyValue('SampleWorkspace')
+        self._output_ws_name = self.getPropertyValue('OutputWorkspace')
+
+        # Get corrections workspace
+        self._corrections_ws_name = self.getPropertyValue('CorrectionsWorkspace')
+        self._use_corrections = self._corrections_ws_name != ''
+
+        # Get container workspace
+        self._can_ws_name = self.getPropertyValue('CanWorkspace')
+        self._use_can = self._can_ws_name != ''
+
+        self._can_scale_factor = self.getProperty('CanScaleFactor').value
+        self._scale_can = self._can_scale_factor != 1.0
+
+        # This temporary WS is needed because ConvertUnits does not like named WS in a Group
+        self._corrections = '__converted_corrections'
+        self._scaled_container = '__scaled_container'
+
+
+    def _get_correction_factor_ws_name(self, factor_type):
+        """
+        Gets the full name for a correction factor workspace given the correction type.
+
+        @param factor_type Factory type (ass, acc, acsc, assc)
+        @return Full name of workspace (None if not found)
+        """
+
+        corrections_ws = mtd[self._corrections_ws_name]
+
+        for ws_name in corrections_ws.getNames():
+            if factor_type in ws_name:
+                return ws_name
+
+        return None
+
+
+    def _pre_process_corrections(self):
+        """
+        If the sample is not in wavelength then convert the corrections to
+        whatever units the sample is in.
+        """
+
+        instrument = mtd[self._sample_ws_name].getInstrument()
+        unit_id = mtd[self._sample_ws_name].getAxis(0).getUnit().unitID()
+        logger.information('x-unit is ' + unit_id)
+
+        factor_types = ['ass']
+        if self._use_can:
+            factor_types.extend(['acc', 'acsc', 'assc'])
+
+        for factor_type in factor_types:
+            input_name = self._get_correction_factor_ws_name(factor_type)
+            output_name = self._corrections + '_' + factor_type
+
+            if unit_id != 'Wavelength':
+                # Configure conversion
+                if unit_id == 'dSpacing':
+                    emode = 'Elastic'
+                    efixed = 0.0
+                elif unit_id == 'DeltaE':
+                    emode = 'Indirect'
+                    efixed = instrument.getNumberParameter('efixed-val')[0]
+                else:
+                    raise ValueError('Unit %s in sample workspace is not supported' % unit_id)
+
+                # Do conversion
+                ConvertUnits(InputWorkspace=input_name,
+                             OutputWorkspace=output_name,
+                             Target=unit_id,
+                             EMode=emode,
+                             EFixed=efixed)
+
+            else:
+                # No need to convert
+                CloneWorkspace(InputWorkspace=input_name,
+                               OutputWorkspace=output_name)
+
+        # Group the temporary factor workspaces (for easy removal later)
+        GroupWorkspaces(InputWorkspaces=[self._corrections + '_' + f_type for f_type in factor_types],
+                        OutputWorkspace=self._corrections)
+
+
+    def _subtract(self):
+        """
+        Do a simple container subtraction (when no corrections are given).
+        """
+
+        logger.information('Using simple container subtraction')
+
+        Minus(LHSWorkspace=self._sample_ws_name,
+              RHSWorkspace=self._scaled_container,
+              OutputWorkspace=self._output_ws_name)
+
+
+    def _correct_sample(self):
+        """
+        Correct for sample only (when no container is given).
+        """
+
+        logger.information('Correcting sample')
+
+        # Ass
+        Divide(LHSWorkspace=self._sample_ws_name,
+               RHSWorkspace=self._corrections + '_ass',
+               OutputWorkspace=self._output_ws_name)
+
+
+    def _correct_sample_can(self):
+        """
+        Correct for sample and container.
+        """
+
+        logger.information('Correcting sample and container')
+        corrected_can_ws = '__corrected_can'
+
+        # Acc
+        Divide(LHSWorkspace=self._scaled_container,
+               RHSWorkspace=self._corrections + '_acc',
+               OutputWorkspace=corrected_can_ws)
+
+        # Acsc
+        Multiply(LHSWorkspace=corrected_can_ws,
+                 RHSWorkspace=self._corrections + '_acsc',
+                 OutputWorkspace=corrected_can_ws)
+        Minus(LHSWorkspace=self._sample_ws_name,
+              RHSWorkspace=corrected_can_ws,
+              OutputWorkspace=self._output_ws_name)
+
+        # Assc
+        Divide(LHSWorkspace=self._output_ws_name,
+               RHSWorkspace=self._corrections + '_assc',
+               OutputWorkspace=self._output_ws_name)
+
+        DeleteWorkspace(corrected_can_ws)
+
+
+# Register algorithm with Mantid
+AlgorithmFactory.subscribe(ApplyPaalmanPingsCorrection)
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectAnnulusAbsorption.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectAnnulusAbsorption.py
index ce5d2aa46a2964f13e5a51a15990c675cd733325..3d9a00cb0c2a169811392736af249204e19b8e31 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectAnnulusAbsorption.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectAnnulusAbsorption.py
@@ -1,6 +1,6 @@
 from mantid.simpleapi import *
-from mantid.api import DataProcessorAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, PropertyMode, Progress
-from mantid.kernel import StringMandatoryValidator, Direction, logger
+from mantid.api import DataProcessorAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, PropertyMode, Progress, WorkspaceGroupProperty
+from mantid.kernel import StringMandatoryValidator, Direction, logger, IntBoundedValidator, FloatBoundedValidator
 
 
 class IndirectAnnulusAbsorption(DataProcessorAlgorithm):
@@ -14,46 +14,71 @@ class IndirectAnnulusAbsorption(DataProcessorAlgorithm):
 
 
     def PyInit(self):
+        # Sample options
         self.declareProperty(MatrixWorkspaceProperty('SampleWorkspace', '', direction=Direction.Input),
                              doc='Sample workspace.')
 
+        self.declareProperty(name='SampleChemicalFormula', defaultValue='',
+                             validator=StringMandatoryValidator(),
+                             doc='Chemical formula for the sample')
+        self.declareProperty(name='SampleNumberDensity', defaultValue=0.1,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Sample number density')
+        self.declareProperty(name='SampleInnerRadius', defaultValue=0.2,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Sample radius')
+        self.declareProperty(name='SampleOuterRadius', defaultValue=0.25,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Sample radius')
+
+        # Container options
         self.declareProperty(MatrixWorkspaceProperty('CanWorkspace', '', optional=PropertyMode.Optional,
                                                      direction=Direction.Input),
                              doc='Container workspace.')
-
-        self.declareProperty(name='CanScaleFactor', defaultValue=1.0, doc='Scale factor to multiply can data')
-
-        self.declareProperty(name='ChemicalFormula', defaultValue='', validator=StringMandatoryValidator(),
-                             doc='Chemical formula')
-
-        self.declareProperty(name='CanInnerRadius', defaultValue=0.2, doc='Sample radius')
-        self.declareProperty(name='SampleInnerRadius', defaultValue=0.15, doc='Sample radius')
-        self.declareProperty(name='SampleOuterRadius', defaultValue=0.16, doc='Sample radius')
-        self.declareProperty(name='CanOuterRadius', defaultValue=0.22, doc='Sample radius')
-        self.declareProperty(name='SampleNumberDensity', defaultValue=0.1, doc='Sample number density')
-        self.declareProperty(name='Events', defaultValue=5000, doc='Number of neutron events')
-        self.declareProperty(name='Plot', defaultValue=False, doc='Plot options')
-
+        self.declareProperty(name='UseCanCorrections', defaultValue=False,
+                             doc='Use can corrections in subtraction')
+        self.declareProperty(name='CanChemicalFormula', defaultValue='',
+                             doc='Chemical formula for the can')
+        self.declareProperty(name='CanNumberDensity', defaultValue=0.1,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Can number density')
+        self.declareProperty(name='CanInnerRadius', defaultValue=0.19,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Sample radius')
+        self.declareProperty(name='CanOuterRadius', defaultValue=0.26,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Sample radius')
+        self.declareProperty(name='CanScaleFactor', defaultValue=1.0,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Scale factor to multiply can data')
+
+        # General options
+        self.declareProperty(name='Events', defaultValue=5000,
+                             validator=IntBoundedValidator(0),
+                             doc='Number of neutron events')
+        self.declareProperty(name='Plot', defaultValue=False,
+                             doc='Plot options')
+
+        # Output options
         self.declareProperty(MatrixWorkspaceProperty('OutputWorkspace', '', direction=Direction.Output),
                              doc='The output corrected workspace.')
 
-        self.declareProperty(MatrixWorkspaceProperty('CorrectionsWorkspace', '', direction=Direction.Output,
-                                                     optional=PropertyMode.Optional),
+        self.declareProperty(WorkspaceGroupProperty('CorrectionsWorkspace', '', direction=Direction.Output,
+                                                    optional=PropertyMode.Optional),
                              doc='The corrections workspace for scattering and absorptions in sample.')
 
 
     def PyExec(self):
-        from IndirectCommon import getEfixed, addSampleLogs
+        from IndirectCommon import getEfixed
 
         self._setup()
 
         # Set up progress reporting
-        n_prog_reports = 4
-        if self._can_ws is not None:
-            n_prog_reports += 2
-        prog_reporter = Progress(self, 0.0, 1.0, n_prog_reports)
+        n_prog_reports = 2
+        if self._can_ws_name is not None:
+            n_prog_reports += 1
+        prog = Progress(self, 0.0, 1.0, n_prog_reports)
 
-        prog_reporter.report('Processing sample')
         efixed = getEfixed(self._sample_ws_name)
 
         sample_wave_ws = '__sam_wave'
@@ -61,71 +86,136 @@ class IndirectAnnulusAbsorption(DataProcessorAlgorithm):
                      Target='Wavelength', EMode='Indirect', EFixed=efixed)
 
         sample_thickness = self._sample_outer_radius - self._sample_inner_radius
+        logger.information('Sample thickness: ' + str(sample_thickness))
 
-        prog_reporter.report('Calculating sample corrections')
+        prog.report('Calculating sample corrections')
         AnnularRingAbsorption(InputWorkspace=sample_wave_ws,
                               OutputWorkspace=self._ass_ws,
                               SampleHeight=3.0,
                               SampleThickness=sample_thickness,
                               CanInnerRadius=self._can_inner_radius,
                               CanOuterRadius=self._can_outer_radius,
-                              SampleChemicalFormula=self._chemical_formula,
-                              SampleNumberDensity=self._number_density,
+                              SampleChemicalFormula=self._sample_chemical_formula,
+                              SampleNumberDensity=self._sample_number_density,
                               NumberOfWavelengthPoints=10,
                               EventsPerPoint=self._events)
 
-        plot_list = [self._output_ws, self._sample_ws_name]
+        plot_data = [self._output_ws, self._sample_ws_name]
+        plot_corr = [self._ass_ws]
+        group = self._ass_ws
 
-        if self._can_ws is not None:
-            prog_reporter.report('Processing can')
-            can_wave_ws = '__can_wave'
-            ConvertUnits(InputWorkspace=self._can_ws, OutputWorkspace=can_wave_ws,
+        if self._can_ws_name is not None:
+            can1_wave_ws = '__can1_wave'
+            can2_wave_ws = '__can2_wave'
+            ConvertUnits(InputWorkspace=self._can_ws_name, OutputWorkspace=can1_wave_ws,
                          Target='Wavelength', EMode='Indirect', EFixed=efixed)
-
             if self._can_scale != 1.0:
                 logger.information('Scaling can by: ' + str(self._can_scale))
-                Scale(InputWorkspace=can_wave_ws, OutputWorkspace=can_wave_ws, Factor=self._can_scale, Operation='Multiply')
+                Scale(InputWorkspace=can1_wave_ws, OutputWorkspace=can1_wave_ws, Factor=self._can_scale, Operation='Multiply')
+            CloneWorkspace(InputWorkspace=can1_wave_ws, OutputWorkspace=can2_wave_ws)
+
+            can_thickness_1 = self._sample_inner_radius - self._can_inner_radius
+            can_thickness_2 = self._can_outer_radius - self._sample_outer_radius
+            logger.information('Can thickness: %f & %f' % (can_thickness_1, can_thickness_2))
+
+            if self._use_can_corrections:
+                prog.report('Calculating container corrections')
+                Divide(LHSWorkspace=sample_wave_ws, RHSWorkspace=self._ass_ws, OutputWorkspace=sample_wave_ws)
+
+                SetSampleMaterial(can1_wave_ws, ChemicalFormula=self._can_chemical_formula, SampleNumberDensity=self._can_number_density)
+                AnnularRingAbsorption(InputWorkspace=can1_wave_ws,
+                              OutputWorkspace='__Acc1',
+                              SampleHeight=3.0,
+                              SampleThickness=can_thickness_1,
+                              CanInnerRadius=self._can_inner_radius,
+                              CanOuterRadius=self._sample_outer_radius,
+                              SampleChemicalFormula=self._can_chemical_formula,
+                              SampleNumberDensity=self._can_number_density,
+                              NumberOfWavelengthPoints=10,
+                              EventsPerPoint=self._events)
+
+                SetSampleMaterial(can2_wave_ws, ChemicalFormula=self._can_chemical_formula, SampleNumberDensity=self._can_number_density)
+                AnnularRingAbsorption(InputWorkspace=can2_wave_ws,
+                              OutputWorkspace='__Acc2',
+                              SampleHeight=3.0,
+                              SampleThickness=can_thickness_2,
+                              CanInnerRadius=self._sample_inner_radius,
+                              CanOuterRadius=self._can_outer_radius,
+                              SampleChemicalFormula=self._can_chemical_formula,
+                              SampleNumberDensity=self._can_number_density,
+                              NumberOfWavelengthPoints=10,
+                              EventsPerPoint=self._events)
+
+                Multiply(LHSWorkspace='__Acc1', RHSWorkspace='__Acc2', OutputWorkspace=self._acc_ws)
+                DeleteWorkspace('__Acc1')
+                DeleteWorkspace('__Acc2')
+
+                Divide(LHSWorkspace=can1_wave_ws, RHSWorkspace=self._acc_ws, OutputWorkspace=can1_wave_ws)
+                Minus(LHSWorkspace=sample_wave_ws, RHSWorkspace=can1_wave_ws, OutputWorkspace=sample_wave_ws)
+                plot_corr.append(self._acc_ws)
+                group += ',' + self._acc_ws
 
-            prog_reporter.report('Applying can corrections')
-            Minus(LHSWorkspace=sample_wave_ws, RHSWorkspace=can_wave_ws, OutputWorkspace=sample_wave_ws)
-            DeleteWorkspace(can_wave_ws)
+            else:
+                prog.report('Calculating can scaling')
+                Minus(LHSWorkspace=sample_wave_ws, RHSWorkspace=can1_wave_ws, OutputWorkspace=sample_wave_ws)
+                Divide(LHSWorkspace=sample_wave_ws, RHSWorkspace=self._ass_ws, OutputWorkspace=sample_wave_ws)
 
-            plot_list.append(self._can_ws)
+            DeleteWorkspace(can1_wave_ws)
+            DeleteWorkspace(can2_wave_ws)
+            plot_data.append(self._can_ws_name)
 
-        prog_reporter.report('Applying corrections')
-        Divide(LHSWorkspace=sample_wave_ws, RHSWorkspace=self._ass_ws, OutputWorkspace=sample_wave_ws)
-        ConvertUnits(InputWorkspace=sample_wave_ws, OutputWorkspace=self._output_ws, Target='DeltaE',
-                     EMode='Indirect', EFixed=efixed)
+        else:
+            Divide(LHSWorkspace=sample_wave_ws,
+                   RHSWorkspace=self._ass_ws,
+                   OutputWorkspace=sample_wave_ws)
+
+        ConvertUnits(InputWorkspace=sample_wave_ws,
+                     OutputWorkspace=self._output_ws,
+                     Target='DeltaE',
+                     EMode='Indirect',
+                     EFixed=efixed)
         DeleteWorkspace(sample_wave_ws)
 
-        prog_reporter.report('Recording sample logs')
-        sample_logs = {'sample_shape': 'annulus',
-                       'sample_filename': self._sample_ws_name,
-                       'sample_inner': self._sample_inner_radius,
-                       'sample_outer': self._sample_outer_radius,
-                       'can_inner': self._can_inner_radius,
-                       'can_outer': self._can_outer_radius}
-        addSampleLogs(self._ass_ws, sample_logs)
-        addSampleLogs(self._output_ws, sample_logs)
-
-        if self._can_ws is not None:
-            AddSampleLog(Workspace=self._ass_ws, LogName='can_filename', LogType='String', LogText=str(self._can_ws))
-            AddSampleLog(Workspace=self._output_ws, LogName='can_filename', LogType='String', LogText=str(self._can_ws))
-            AddSampleLog(Workspace=self._ass_ws, LogName='can_scale', LogType='String', LogText=str(self._can_scale))
-            AddSampleLog(Workspace=self._output_ws, LogName='can_scale', LogType='String', LogText=str(self._can_scale))
+        prog.report('Recording sample logs')
+        sample_log_workspaces = [self._output_ws, self._ass_ws]
+        sample_logs = [('sample_shape', 'annulus'),
+                       ('sample_filename', self._sample_ws_name),
+                       ('sample_inner', self._sample_inner_radius),
+                       ('sample_outer', self._sample_outer_radius),
+                       ('can_inner', self._can_inner_radius),
+                       ('can_outer', self._can_outer_radius)]
+
+        if self._can_ws_name is not None:
+            sample_logs.append(('can_filename', self._can_ws_name))
+            sample_logs.append(('can_scale', self._can_scale))
+            if self._use_can_corrections:
+                sample_log_workspaces.append(self._acc_ws)
+                sample_logs.append(('can_thickness_1', can_thickness_1))
+                sample_logs.append(('can_thickness_2', can_thickness_2))
+
+        log_names = [item[0] for item in sample_logs]
+        log_values = [item[1] for item in sample_logs]
+
+        for ws_name in sample_log_workspaces:
+            AddSampleLogMultiple(Workspace=ws_name, LogNames=log_names, LogValues=log_values)
 
         self.setProperty('OutputWorkspace', self._output_ws)
 
         # Output the Ass workspace if it is wanted, delete if not
-        if self._ass_ws == '_ass':
+        if self._abs_ws == '':
             DeleteWorkspace(self._ass_ws)
+            if self._can_ws_name is not None and self._use_can_corrections:
+                DeleteWorkspace(self._acc_ws)
         else:
-            self.setProperty('CorrectionsWorkspace', self._ass_ws)
+            GroupWorkspaces(InputWorkspaces=group, OutputWorkspace=self._abs_ws)
+            self.setProperty('CorrectionsWorkspace', self._abs_ws)
 
         if self._plot:
             from IndirectImport import import_mantidplot
             mantid_plot = import_mantidplot()
-            mantid_plot.plotSpectrum(plot_list, 0)
+            mantid_plot.plotSpectrum(plot_data, 0)
+            if self._abs_ws != '':
+                mantid_plot.plotSpectrum(plot_corr, 0)
 
 
     def _setup(self):
@@ -134,24 +224,59 @@ class IndirectAnnulusAbsorption(DataProcessorAlgorithm):
         """
 
         self._sample_ws_name = self.getPropertyValue('SampleWorkspace')
-        self._can_scale = self.getProperty('CanScaleFactor').value
-        self._chemical_formula = self.getPropertyValue('ChemicalFormula')
-        self._number_density = self.getProperty('SampleNumberDensity').value
-        self._can_inner_radius = self.getProperty('CanInnerRadius').value
+        self._sample_chemical_formula = self.getPropertyValue('SampleChemicalFormula')
+        self._sample_number_density = self.getProperty('SampleNumberDensity').value
         self._sample_inner_radius = self.getProperty('SampleInnerRadius').value
         self._sample_outer_radius = self.getProperty('SampleOuterRadius').value
+
+        self._can_ws_name = self.getPropertyValue('CanWorkspace')
+        if self._can_ws_name == '':
+            self._can_ws_name = None
+        self._use_can_corrections = self.getProperty('UseCanCorrections').value
+        self._can_chemical_formula = self.getPropertyValue('CanChemicalFormula')
+        self._can_number_density = self.getProperty('CanNumberDensity').value
+        self._can_inner_radius = self.getProperty('CanInnerRadius').value
         self._can_outer_radius = self.getProperty('CanOuterRadius').value
+        self._can_scale = self.getProperty('CanScaleFactor').value
+
         self._events = self.getProperty('Events').value
         self._plot = self.getProperty('Plot').value
         self._output_ws = self.getPropertyValue('OutputWorkspace')
 
-        self._ass_ws = self.getPropertyValue('CorrectionsWorkspace')
-        if self._ass_ws == '':
+        self._abs_ws = self.getPropertyValue('CorrectionsWorkspace')
+        if self._abs_ws == '':
             self._ass_ws = '__ass'
+            self._acc_ws = '__acc'
+        else:
+            self._ass_ws = self._abs_ws + '_ass'
+            self._acc_ws = self._abs_ws + '_acc'
+
+
+    def validateInputs(self):
+        """
+        Validate algorithm options.
+        """
+
+        self._setup()
+        issues = dict()
+
+        if self._use_can_corrections and self._can_chemical_formula == '':
+            issues['CanChemicalFormula'] = 'Must be set to use can corrections'
+
+        if self._use_can_corrections and self._can_ws_name is None:
+            issues['UseCanCorrections'] = 'Must specify a can workspace to use can corections'
+
+        # Geometry validation: can inner < sample inner < sample outer < can outer
+        if self._sample_inner_radius < self._can_inner_radius:
+            issues['SampleInnerRadius'] = 'Must be greater than CanInnerRadius'
+
+        if self._sample_outer_radius < self._sample_inner_radius:
+            issues['SampleOuterRadius'] = 'Must be greater than SampleInnerRadius'
+
+        if self._can_outer_radius < self._sample_outer_radius:
+            issues['CanOuterRadius'] = 'Must be greater than SampleOuterRadius'
 
-        self._can_ws = self.getPropertyValue('CanWorkspace')
-        if self._can_ws == '':
-            self._can_ws = None
+        return issues
 
 
 # Register algorithm with Mantid
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCylinderAbsorption.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCylinderAbsorption.py
index d22e65e0440492c48e4fe33a2c5333bccf2e6785..c413199a8992d57da7448efda74f8bbfb64de575 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCylinderAbsorption.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectCylinderAbsorption.py
@@ -1,10 +1,28 @@
 from mantid.simpleapi import *
-from mantid.api import DataProcessorAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, PropertyMode, Progress
-from mantid.kernel import StringMandatoryValidator, Direction, logger
+from mantid.api import DataProcessorAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, WorkspaceGroupProperty, PropertyMode, Progress
+from mantid.kernel import StringMandatoryValidator, Direction, logger, FloatBoundedValidator, IntBoundedValidator
 
 
 class IndirectCylinderAbsorption(DataProcessorAlgorithm):
 
+    _sample_ws_name = None
+    _sample_chemical_formula = None
+    _sample_number_density = None
+    _sample_radius = None
+    _can_ws_name = None
+    _use_can_corrections = None
+    _can_chemical_formula = None
+    _can_number_density = None
+    _can_radius = None
+    _can_scale = None
+    _events = None
+    _plot = None
+    _output_ws = None
+    _abs_ws = None
+    _ass_ws = None
+    _acc_ws = None
+
+
     def category(self):
         return "Workflow\\Inelastic;PythonAlgorithms;CorrectionFunctions\\AbsorptionCorrections;Workflow\\MIDAS"
 
@@ -14,109 +32,172 @@ class IndirectCylinderAbsorption(DataProcessorAlgorithm):
 
 
     def PyInit(self):
+        # Sample options
         self.declareProperty(MatrixWorkspaceProperty('SampleWorkspace', '', direction=Direction.Input),
                              doc='Sample workspace.')
-
+        self.declareProperty(name='SampleChemicalFormula', defaultValue='', validator=StringMandatoryValidator(),
+                             doc='Sample chemical formula')
+        self.declareProperty(name='SampleNumberDensity', defaultValue=0.1,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Sample number density')
+        self.declareProperty(name='SampleRadius', defaultValue=0.1,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Sample radius')
+
+        # Container options
         self.declareProperty(MatrixWorkspaceProperty('CanWorkspace', '', optional=PropertyMode.Optional,
                                                      direction=Direction.Input),
                              doc='Container workspace.')
-
-        self.declareProperty(name='CanScaleFactor', defaultValue=1.0, doc='Scale factor to multiply can data')
-
-        self.declareProperty(name='ChemicalFormula', defaultValue='', validator=StringMandatoryValidator(),
-                             doc='Chemical formula')
-
-        self.declareProperty(name='SampleRadius', defaultValue=0.5, doc='Sample radius')
-        self.declareProperty(name='SampleNumberDensity', defaultValue=0.1, doc='Sample number density')
-        self.declareProperty(name='Plot', defaultValue=False, doc='Plot options')
-
+        self.declareProperty(name='UseCanCorrections', defaultValue=False,
+                             doc='Use can corrections in subtraction')
+        self.declareProperty(name='CanChemicalFormula', defaultValue='',
+                             doc='Can chemical formula')
+        self.declareProperty(name='CanNumberDensity', defaultValue=0.1,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Can number density')
+        self.declareProperty(name='CanRadius', defaultValue=0.2,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Can radius')
+        self.declareProperty(name='CanScaleFactor', defaultValue=1.0,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Scale factor to multiply can data')
+
+        # General options
+        self.declareProperty(name='Events', defaultValue=5000,
+                             validator=IntBoundedValidator(0),
+                             doc='Number of neutron events')
+        self.declareProperty(name='Plot', defaultValue=False,
+                             doc='Plot options')
+
+        # Output options
         self.declareProperty(MatrixWorkspaceProperty('OutputWorkspace', '', direction=Direction.Output),
                              doc='The output corrected workspace.')
 
-        self.declareProperty(MatrixWorkspaceProperty('CorrectionsWorkspace', '', direction=Direction.Output,
-                                                     optional=PropertyMode.Optional),
+        self.declareProperty(WorkspaceGroupProperty('CorrectionsWorkspace', '', direction=Direction.Output,
+                                                    optional=PropertyMode.Optional),
                              doc='The corrections workspace for scattering and absorptions in sample.')
 
 
     def PyExec(self):
-        from IndirectCommon import getEfixed, addSampleLogs
+        from IndirectCommon import getEfixed
 
         self._setup()
 
         # Set up progress reporting
-        n_prog_reports = 4
-        if self._can_ws is not None:
-            n_prog_reports += 2
-        prog_reporter = Progress(self, 0.0, 1.0, n_prog_reports)
+        n_prog_reports = 2
+        if self._can_ws_name is not None:
+            n_prog_reports += 1
+        prog = Progress(self, 0.0, 1.0, n_prog_reports)
 
-        prog_reporter.report('Processing sample')
-        efixed = getEfixed(self._sample_ws)
+        efixed = getEfixed(self._sample_ws_name)
 
         sample_wave_ws = '__sam_wave'
-        ConvertUnits(InputWorkspace=self._sample_ws, OutputWorkspace=sample_wave_ws,
+        ConvertUnits(InputWorkspace=self._sample_ws_name, OutputWorkspace=sample_wave_ws,
                      Target='Wavelength', EMode='Indirect', EFixed=efixed)
 
-        SetSampleMaterial(sample_wave_ws, ChemicalFormula=self._chemical_formula, SampleNumberDensity=self._number_density)
+        SetSampleMaterial(sample_wave_ws, ChemicalFormula=self._sample_chemical_formula, SampleNumberDensity=self._sample_number_density)
 
-        prog_reporter.report('Calculating sample corrections')
+        prog.report('Calculating sample corrections')
         CylinderAbsorption(InputWorkspace=sample_wave_ws,
                            OutputWorkspace=self._ass_ws,
-                           SampleNumberDensity=self._number_density,
+                           SampleNumberDensity=self._sample_number_density,
                            NumberOfWavelengthPoints=10,
                            CylinderSampleHeight=3.0,
                            CylinderSampleRadius=self._sample_radius,
                            NumberOfSlices=1,
                            NumberOfAnnuli=10)
 
-        plot_list = [self._output_ws, self._sample_ws]
+        plot_data = [self._output_ws, self._sample_ws_name]
+        plot_corr = [self._ass_ws]
+        group = self._ass_ws
 
-        if self._can_ws is not None:
-            prog_reporter.report('Processing can')
+        if self._can_ws_name is not None:
             can_wave_ws = '__can_wave'
-            ConvertUnits(InputWorkspace=self._can_ws, OutputWorkspace=can_wave_ws,
+            ConvertUnits(InputWorkspace=self._can_ws_name, OutputWorkspace=can_wave_ws,
                          Target='Wavelength', EMode='Indirect', EFixed=efixed)
-
             if self._can_scale != 1.0:
                 logger.information('Scaling can by: ' + str(self._can_scale))
                 Scale(InputWorkspace=can_wave_ws, OutputWorkspace=can_wave_ws, Factor=self._can_scale, Operation='Multiply')
 
-            prog_reporter.report('Applying can corrections')
-            Minus(LHSWorkspace=sample_wave_ws, RHSWorkspace=can_wave_ws, OutputWorkspace=sample_wave_ws)
+            can_thickness = self._can_radius - self._sample_radius
+            logger.information('Can thickness: ' + str(can_thickness))
+
+            if self._use_can_corrections:
+                # Doing can corrections
+                prog.report('Calculating can corrections')
+                Divide(LHSWorkspace=sample_wave_ws, RHSWorkspace=self._ass_ws, OutputWorkspace=sample_wave_ws)
+
+                SetSampleMaterial(can_wave_ws, ChemicalFormula=self._can_chemical_formula, SampleNumberDensity=self._can_number_density)
+                AnnularRingAbsorption(InputWorkspace=can_wave_ws,
+                              OutputWorkspace=self._acc_ws,
+                              SampleHeight=3.0,
+                              SampleThickness=can_thickness,
+                              CanInnerRadius=0.9*self._sample_radius,
+                              CanOuterRadius=1.1*self._can_radius,
+                              SampleChemicalFormula=self._can_chemical_formula,
+                              SampleNumberDensity=self._can_number_density,
+                              NumberOfWavelengthPoints=10,
+                              EventsPerPoint=self._events)
+
+                Divide(LHSWorkspace=can_wave_ws, RHSWorkspace=self._acc_ws, OutputWorkspace=can_wave_ws)
+                Minus(LHSWorkspace=sample_wave_ws, RHSWorkspace=can_wave_ws, OutputWorkspace=sample_wave_ws)
+                plot_corr.append(self._acc_ws)
+                group += ',' + self._acc_ws
+
+            else:
+                # Doing simple can subtraction
+                prog.report('Calculating can scaling')
+                Minus(LHSWorkspace=sample_wave_ws, RHSWorkspace=can_wave_ws, OutputWorkspace=sample_wave_ws)
+                Divide(LHSWorkspace=sample_wave_ws, RHSWorkspace=self._ass_ws, OutputWorkspace=sample_wave_ws)
+
             DeleteWorkspace(can_wave_ws)
+            plot_data.append(self._can_ws_name)
 
-            plot_list.append(self._can_ws)
+        else:
+            Divide(LHSWorkspace=sample_wave_ws, RHSWorkspace=self._ass_ws, OutputWorkspace=sample_wave_ws)
 
-        prog_reporter.report('Applying corrections')
-        Divide(LHSWorkspace=sample_wave_ws, RHSWorkspace=self._ass_ws, OutputWorkspace=sample_wave_ws)
         ConvertUnits(InputWorkspace=sample_wave_ws, OutputWorkspace=self._output_ws,
                      Target='DeltaE', EMode='Indirect', EFixed=efixed)
         DeleteWorkspace(sample_wave_ws)
 
-        prog_reporter.report('Recording sample logs')
-        sample_logs = {'sample_shape': 'cylinder',
-                       'sample_filename': self._sample_ws,
-                       'sample_radius': self._sample_radius}
-        addSampleLogs(self._ass_ws, sample_logs)
-        addSampleLogs(self._output_ws, sample_logs)
+        # Record sample logs
+        prog.report('Recording sample logs')
+        sample_log_workspaces = [self._output_ws, self._ass_ws]
+        sample_logs = [('sample_shape', 'cylinder'),
+                       ('sample_filename', self._sample_ws_name),
+                       ('sample_radius', self._sample_radius)]
+
+        if self._can_ws_name is not None:
+            sample_logs.append(('can_filename', self._can_ws_name))
+            sample_logs.append(('can_scale', self._can_scale))
+            if self._use_can_corrections:
+                sample_log_workspaces.append(self._acc_ws)
+                sample_logs.append(('can_thickness', can_thickness))
+
+        log_names = [item[0] for item in sample_logs]
+        log_values = [item[1] for item in sample_logs]
 
-        if self._can_ws is not None:
-            AddSampleLog(Workspace=self._ass_ws, LogName='can_filename', LogType='String', LogText=str(self._can_ws))
-            AddSampleLog(Workspace=self._output_ws, LogName='can_filename', LogType='String', LogText=str(self._can_ws))
-            AddSampleLog(Workspace=self._ass_ws, LogName='can_scale', LogType='String', LogText=str(self._can_scale))
-            AddSampleLog(Workspace=self._output_ws, LogName='can_scale', LogType='String', LogText=str(self._can_scale))
+        for ws_name in sample_log_workspaces:
+            AddSampleLogMultiple(Workspace=ws_name, LogNames=log_names, LogValues=log_values)
 
         self.setProperty('OutputWorkspace', self._output_ws)
 
-        # Output the Ass workspace if it is wanted, delete if not
-        if self._ass_ws == '_ass':
+        # Output the Abs group workspace if it is wanted, delete if not
+        if self._abs_ws == '':
             DeleteWorkspace(self._ass_ws)
+            if self._can_ws_name is not None and self._use_can_corrections:
+                DeleteWorkspace(self._acc_ws)
+
         else:
-            self.setProperty('CorrectionsWorkspace', self._ass_ws)
+            GroupWorkspaces(InputWorkspaces=group, OutputWorkspace=self._abs_ws)
+            self.setProperty('CorrectionsWorkspace', self._abs_ws)
 
         if self._plot:
             from IndirectImport import import_mantidplot
             mantid_plot = import_mantidplot()
-            mantid_plot.plotSpectrum(plot_list, 0)
+            mantid_plot.plotSpectrum(plot_data, 0)
+            if self._abs_ws != '':
+                mantid_plot.plotSpectrum(plot_corr, 0)
 
 
     def _setup(self):
@@ -124,21 +205,53 @@ class IndirectCylinderAbsorption(DataProcessorAlgorithm):
         Get algorithm properties.
         """
 
-        self._sample_ws = self.getPropertyValue('SampleWorkspace')
-        self._can_scale = self.getProperty('CanScaleFactor').value
-        self._chemical_formula = self.getPropertyValue('ChemicalFormula')
-        self._number_density = self.getProperty('SampleNumberDensity').value
+        self._sample_ws_name = self.getPropertyValue('SampleWorkspace')
+        self._sample_chemical_formula = self.getPropertyValue('SampleChemicalFormula')
+        self._sample_number_density = self.getProperty('SampleNumberDensity').value
         self._sample_radius = self.getProperty('SampleRadius').value
+
+        self._can_ws_name = self.getPropertyValue('CanWorkspace')
+        if self._can_ws_name == '':
+            self._can_ws_name = None
+
+        self._use_can_corrections = self.getProperty('UseCanCorrections').value
+        self._can_chemical_formula = self.getPropertyValue('CanChemicalFormula')
+        self._can_number_density = self.getProperty('CanNumberDensity').value
+        self._can_radius = self.getProperty('CanRadius').value
+        self._can_scale = self.getProperty('CanScaleFactor').value
+
+        self._events = self.getPropertyValue('Events')
         self._plot = self.getProperty('Plot').value
+
         self._output_ws = self.getPropertyValue('OutputWorkspace')
 
-        self._ass_ws = self.getPropertyValue('CorrectionsWorkspace')
-        if self._ass_ws == '':
+        self._abs_ws = self.getPropertyValue('CorrectionsWorkspace')
+        if self._abs_ws == '':
             self._ass_ws = '__ass'
+            self._acc_ws = '__acc'
+        else:
+            self._ass_ws = self._abs_ws + '_ass'
+            self._acc_ws = self._abs_ws + '_acc'
+
+
+    def validateInputs(self):
+        """
+        Validate algorithm options.
+        """
+
+        self._setup()
+        issues = dict()
+
+        if self._sample_radius > self._can_radius:
+            issues['CanRadius'] = 'Must be greater than SampleRadius'
+
+        if self._use_can_corrections and self._can_chemical_formula == '':
+            issues['CanChemicalFormula'] = 'Must be set to use can corrections'
+
+        if self._use_can_corrections and self._can_ws_name is None:
+            issues['UseCanCorrections'] = 'Must specify a can workspace to use can corections'
 
-        self._can_ws = self.getPropertyValue('CanWorkspace')
-        if self._can_ws == '':
-            self._can_ws = None
+        return issues
 
 
 # Register algorithm with Mantid
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectFlatPlateAbsorption.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectFlatPlateAbsorption.py
index 0fb3e2c3fe040c9a804c0f2a61a128f5c6febf69..4651084b326a647d8b49c97c2de61c46865b40cb 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectFlatPlateAbsorption.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectFlatPlateAbsorption.py
@@ -1,10 +1,31 @@
 from mantid.simpleapi import *
-from mantid.api import DataProcessorAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, PropertyMode, Progress
-from mantid.kernel import StringMandatoryValidator, Direction, logger
+from mantid.api import DataProcessorAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, PropertyMode, Progress, WorkspaceGroupProperty
+from mantid.kernel import StringMandatoryValidator, Direction, logger, FloatBoundedValidator
 
 
 class IndirectFlatPlateAbsorption(DataProcessorAlgorithm):
 
+    _sample_ws = None
+    _sample_chemical_formula = None
+    _sample_number_density = None
+    _sample_height = None
+    _sample_width = None
+    _sample_thickness = None
+    _can_ws_name = None
+    _use_can_corrections = None
+    _can_chemical_formula = None
+    _can_number_density = None
+    _can_front_thickness = None
+    _can_back_thickness = None
+    _can_scale = None
+    _element_size = None
+    _plot = None
+    _output_ws = None
+    _abs_ws = None
+    _ass_ws = None
+    _acc_ws = None
+
+
     def category(self):
         return "Workflow\\Inelastic;PythonAlgorithms;CorrectionFunctions\\AbsorptionCorrections;Workflow\\MIDAS"
 
@@ -14,116 +35,179 @@ class IndirectFlatPlateAbsorption(DataProcessorAlgorithm):
 
 
     def PyInit(self):
+        # Sample
         self.declareProperty(MatrixWorkspaceProperty('SampleWorkspace', '', direction=Direction.Input),
-                             doc='Sample workspace.')
-
+                             doc='Sample workspace')
+        self.declareProperty(name='SampleChemicalFormula', defaultValue='',
+                             validator=StringMandatoryValidator(),
+                             doc='Chemical formula for the sample')
+        self.declareProperty(name='SampleNumberDensity', defaultValue=0.1,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Sample number density')
+        self.declareProperty(name='SampleHeight', defaultValue=1.0,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Sample height')
+        self.declareProperty(name='SampleWidth', defaultValue=1.0,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Sample width')
+        self.declareProperty(name='SampleThickness', defaultValue=0.5,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Sample thickness')
+
+        # Container
         self.declareProperty(MatrixWorkspaceProperty('CanWorkspace', '', optional=PropertyMode.Optional,
                                                      direction=Direction.Input),
-                             doc='Container workspace.')
-
-        self.declareProperty(name='CanScaleFactor', defaultValue=1.0, doc='Scale factor to multiply can data')
-
-        self.declareProperty(name='ChemicalFormula', defaultValue='', validator=StringMandatoryValidator(),
-                             doc='Chemical formula')
-
-        self.declareProperty(name='SampleHeight', defaultValue=1.0, doc='Sample height')
-        self.declareProperty(name='SampleWidth', defaultValue=1.0, doc='Sample width')
-        self.declareProperty(name='SampleThickness', defaultValue=0.1, doc='Sample thickness')
-        self.declareProperty(name='ElementSize', defaultValue=0.1, doc='Element size in mm')
-        self.declareProperty(name='SampleNumberDensity', defaultValue=0.1, doc='Sample number density')
-        self.declareProperty(name='Plot', defaultValue=False, doc='Plot options')
-
+                             doc='Container workspace')
+        self.declareProperty(name='UseCanCorrections', defaultValue=False,
+                             doc='Use can corrections in subtraction')
+        self.declareProperty(name='CanChemicalFormula', defaultValue='',
+                             doc='Chemical formula for the Container')
+        self.declareProperty(name='CanNumberDensity', defaultValue=0.1,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Container number density')
+        self.declareProperty(name='CanFrontThickness', defaultValue=0.1,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Can front thickness')
+        self.declareProperty(name='CanBackThickness', defaultValue=0.1,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Can back thickness')
+        self.declareProperty(name='CanScaleFactor', defaultValue=1.0,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Scale factor to multiply can data')
+
+        # General
+        self.declareProperty(name='ElementSize', defaultValue=0.1,
+                             validator=FloatBoundedValidator(0.0),
+                             doc='Element size in mm')
+        self.declareProperty(name='Plot', defaultValue=False,
+                             doc='Plot options')
+
+        # Output
         self.declareProperty(MatrixWorkspaceProperty('OutputWorkspace', '', direction=Direction.Output),
-                             doc='The output corrected workspace.')
+                             doc='The output corrected workspace')
+
+        self.declareProperty(WorkspaceGroupProperty('CorrectionsWorkspace', '', direction=Direction.Output,
+                                                    optional=PropertyMode.Optional),
+                             doc='The workspace group to save correction factors')
 
-        self.declareProperty(MatrixWorkspaceProperty('CorrectionsWorkspace', '', direction=Direction.Output,
-                                                     optional=PropertyMode.Optional),
-                             doc='The corrections workspace for scattering and absorptions in sample.')
 
     def PyExec(self):
-        from IndirectCommon import getEfixed, addSampleLogs
+        from IndirectCommon import getEfixed
 
         self._setup()
 
         # Set up progress reporting
-        n_prog_reports = 4
-        if self._can_ws is not None:
-            n_prog_reports += 2
-        prog_reporter = Progress(self, 0.0, 1.0, n_prog_reports)
+        n_prog_reports = 2
+        if self._can_ws_name is not None:
+            n_prog_reports += 1
+        prog = Progress(self, 0.0, 1.0, n_prog_reports)
 
-        prog_reporter.report('Processing sample')
         efixed = getEfixed(self._sample_ws)
 
         sample_wave_ws = '__sam_wave'
         ConvertUnits(InputWorkspace=self._sample_ws, OutputWorkspace=sample_wave_ws,
                      Target='Wavelength', EMode='Indirect', EFixed=efixed)
 
-        SetSampleMaterial(sample_wave_ws, ChemicalFormula=self._chemical_formula, SampleNumberDensity=self._number_density)
+        SetSampleMaterial(sample_wave_ws, ChemicalFormula=self._sample_chemical_formula, SampleNumberDensity=self._sample_number_density)
 
-        prog_reporter.report('Calculating sample corrections')
+        prog.report('Calculating sample corrections')
         FlatPlateAbsorption(InputWorkspace=sample_wave_ws,
                             OutputWorkspace=self._ass_ws,
                             SampleHeight=self._sample_height,
                             SampleWidth=self._sample_width,
-                            SampleThickness=self._sample_thichness,
+                            SampleThickness=self._sample_thickness,
                             ElementSize=self._element_size,
                             EMode='Indirect',
                             EFixed=efixed,
                             NumberOfWavelengthPoints=10)
 
-        plot_list = [self._output_ws, self._sample_ws]
+        plot_data = [self._output_ws, self._sample_ws]
+        plot_corr = [self._ass_ws]
+        group = self._ass_ws
 
-        if self._can_ws is not None:
-            prog_reporter.report('Processing can')
+        if self._can_ws_name is not None:
             can_wave_ws = '__can_wave'
-            ConvertUnits(InputWorkspace=self._can_ws, OutputWorkspace=can_wave_ws,
+            ConvertUnits(InputWorkspace=self._can_ws_name, OutputWorkspace=can_wave_ws,
                          Target='Wavelength', EMode='Indirect', EFixed=efixed)
-
             if self._can_scale != 1.0:
                 logger.information('Scaling can by: ' + str(self._can_scale))
                 Scale(InputWorkspace=can_wave_ws, OutputWorkspace=can_wave_ws, Factor=self._can_scale, Operation='Multiply')
 
-            prog_reporter.report('Applying can corrections')
-            Minus(LHSWorkspace=sample_wave_ws, RHSWorkspace=can_wave_ws, OutputWorkspace=sample_wave_ws)
+            if self._use_can_corrections:
+                prog.report('Calculating container corrections')
+                Divide(LHSWorkspace=sample_wave_ws, RHSWorkspace=self._ass_ws, OutputWorkspace=sample_wave_ws)
+
+                SetSampleMaterial(can_wave_ws, ChemicalFormula=self._can_chemical_formula, SampleNumberDensity=self._can_number_density)
+                FlatPlateAbsorption(InputWorkspace=can_wave_ws,
+                                OutputWorkspace=self._acc_ws,
+                                SampleHeight=self._sample_height,
+                                SampleWidth=self._sample_width,
+                                SampleThickness=self._can_front_thickness + self._can_back_thickness,
+                                ElementSize=self._element_size,
+                                EMode='Indirect',
+                                EFixed=efixed,
+                                NumberOfWavelengthPoints=10)
+
+                Divide(LHSWorkspace=can_wave_ws, RHSWorkspace=self._acc_ws, OutputWorkspace=can_wave_ws)
+                Minus(LHSWorkspace=sample_wave_ws, RHSWorkspace=can_wave_ws, OutputWorkspace=sample_wave_ws)
+                plot_corr.append(self._acc_ws)
+                group += ',' + self._acc_ws
+
+            else:
+                prog.report('Calculating container scaling')
+                Minus(LHSWorkspace=sample_wave_ws, RHSWorkspace=can_wave_ws, OutputWorkspace=sample_wave_ws)
+                Divide(LHSWorkspace=sample_wave_ws, RHSWorkspace=self._ass_ws, OutputWorkspace=sample_wave_ws)
+
             DeleteWorkspace(can_wave_ws)
+            plot_data.append(self._can_ws_name)
 
-            plot_list.append(self._can_ws)
+        else:
+            Divide(LHSWorkspace=sample_wave_ws, RHSWorkspace=self._ass_ws, OutputWorkspace=sample_wave_ws)
 
-        prog_reporter.report('Applying corrections')
-        Divide(LHSWorkspace=sample_wave_ws, RHSWorkspace=self._ass_ws, OutputWorkspace=sample_wave_ws)
         ConvertUnits(InputWorkspace=sample_wave_ws, OutputWorkspace=self._output_ws,
                      Target='DeltaE', EMode='Indirect', EFixed=efixed)
         DeleteWorkspace(sample_wave_ws)
 
-        prog_reporter.report('Recording sample logs')
-        sample_logs = {'sample_shape': 'flatplate',
-                       'sample_filename': self._sample_ws,
-                       'sample_height': self._sample_height,
-                       'sample_width': self._sample_width,
-                       'sample_thickness': self._sample_thichness,
-                       'element_size': self._element_size}
-        addSampleLogs(self._ass_ws, sample_logs)
-        addSampleLogs(self._output_ws, sample_logs)
-
-        if self._can_ws is not None:
-            AddSampleLog(Workspace=self._ass_ws, LogName='can_filename', LogType='String', LogText=str(self._can_ws))
-            AddSampleLog(Workspace=self._output_ws, LogName='can_filename', LogType='String', LogText=str(self._can_ws))
-            AddSampleLog(Workspace=self._ass_ws, LogName='can_scale', LogType='String', LogText=str(self._can_scale))
-            AddSampleLog(Workspace=self._output_ws, LogName='can_scale', LogType='String', LogText=str(self._can_scale))
+        prog.report('Recording samle logs')
+        sample_log_workspaces = [self._output_ws, self._ass_ws]
+        sample_logs = [('sample_shape', 'flatplate'),
+                       ('sample_filename', self._sample_ws),
+                       ('sample_height', self._sample_height),
+                       ('sample_width', self._sample_width),
+                       ('sample_thickness', self._sample_thickness),
+                       ('element_size', self._element_size)]
+
+        if self._can_ws_name is not None:
+            sample_logs.append(('can_filename', self._can_ws_name))
+            sample_logs.append(('can_scale', self._can_scale))
+            if self._use_can_corrections:
+                sample_log_workspaces.append(self._acc_ws)
+                sample_logs.append(('can_front_thickness', self. _can_front_thickness))
+                sample_logs.append(('can_back_thickness', self. _can_back_thickness))
+
+        log_names = [item[0] for item in sample_logs]
+        log_values = [item[1] for item in sample_logs]
+
+        for ws_name in sample_log_workspaces:
+            AddSampleLogMultiple(Workspace=ws_name, LogNames=log_names, LogValues=log_values)
 
         self.setProperty('OutputWorkspace', self._output_ws)
 
         # Output the Ass workspace if it is wanted, delete if not
-        if self._ass_ws == '_ass':
+        if self._abs_ws == '':
             DeleteWorkspace(self._ass_ws)
+            if self._can_ws_name is not None and self._use_can_corrections:
+                DeleteWorkspace(self._acc_ws)
         else:
-            self.setProperty('CorrectionsWorkspace', self._ass_ws)
+            GroupWorkspaces(InputWorkspaces=group, OutputWorkspace=self._abs_ws)
+            self.setProperty('CorrectionsWorkspace', self._abs_ws)
 
         if self._plot:
-            prog_reporter.report('Plotting')
             from IndirectImport import import_mantidplot
             mantid_plot = import_mantidplot()
-            mantid_plot.plotSpectrum(plot_list, 0)
+            mantid_plot.plotSpectrum(plot_data, 0)
+            if self._abs_ws != '':
+                mantid_plot.plotSpectrum(plot_corr, 0)
 
 
     def _setup(self):
@@ -132,23 +216,50 @@ class IndirectFlatPlateAbsorption(DataProcessorAlgorithm):
         """
 
         self._sample_ws = self.getPropertyValue('SampleWorkspace')
-        self._can_scale = self.getProperty('CanScaleFactor').value
-        self._chemical_formula = self.getPropertyValue('ChemicalFormula')
-        self._number_density = self.getProperty('SampleNumberDensity').value
+        self._sample_chemical_formula = self.getPropertyValue('SampleChemicalFormula')
+        self._sample_number_density = self.getProperty('SampleNumberDensity').value
         self._sample_height = self.getProperty('SampleHeight').value
         self._sample_width = self.getProperty('SampleWidth').value
-        self._sample_thichness = self.getProperty('SampleThickness').value
+        self._sample_thickness = self.getProperty('SampleThickness').value
+
+        self._can_ws_name = self.getPropertyValue('CanWorkspace')
+        if self._can_ws_name == '':
+            self._can_ws_name = None
+        self._use_can_corrections = self.getProperty('UseCanCorrections').value
+        self._can_chemical_formula = self.getPropertyValue('CanChemicalFormula')
+        self._can_number_density = self.getProperty('CanNumberDensity').value
+        self._can_front_thickness = self.getProperty('CanFrontThickness').value
+        self._can_back_thickness = self.getProperty('CanBackThickness').value
+        self._can_scale = self.getProperty('CanScaleFactor').value
+
         self._element_size = self.getProperty('ElementSize').value
         self._plot = self.getProperty('Plot').value
         self._output_ws = self.getPropertyValue('OutputWorkspace')
 
-        self._ass_ws = self.getPropertyValue('CorrectionsWorkspace')
-        if self._ass_ws == '':
+        self._abs_ws = self.getPropertyValue('CorrectionsWorkspace')
+        if self._abs_ws == '':
             self._ass_ws = '__ass'
+            self._acc_ws = '__acc'
+        else:
+            self._ass_ws = self._abs_ws + '_ass'
+            self._acc_ws = self._abs_ws + '_acc'
+
+
+    def validateInputs(self):
+        """
+        Validate algorithm options.
+        """
+
+        self._setup()
+        issues = dict()
+
+        if self._use_can_corrections and self._can_chemical_formula == '':
+            issues['CanChemicalFormula'] = 'Must be set to use can corrections'
+
+        if self._use_can_corrections and self._can_ws_name is None:
+            issues['UseCanCorrections'] = 'Must specify a can workspace to use can corections'
 
-        self._can_ws = self.getPropertyValue('CanWorkspace')
-        if self._can_ws == '':
-            self._can_ws = None
+        return issues
 
 
 # Register algorithm with Mantid
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/InelasticIndirectReduction.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/InelasticIndirectReduction.py
index aee835a8773649cedb5f47404fe10da87841ed6c..39070394a695e4f5815bd9135966038d838d16d4 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/InelasticIndirectReduction.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/InelasticIndirectReduction.py
@@ -77,13 +77,10 @@ class InelasticIndirectReduction(DataProcessorAlgorithm):
 
     def PyExec(self):
         from mantid import config, logger
-        from IndirectCommon import StartTime, EndTime
         import inelastic_indirect_reducer
 
         self._setup()
 
-        StartTime('InelasticIndirectReduction')
-
         # Setup reducer
         reducer = inelastic_indirect_reducer.IndirectReducer()
 
@@ -157,8 +154,6 @@ class InelasticIndirectReduction(DataProcessorAlgorithm):
         if self._plot_type != 'none':
             self._plot()
 
-        EndTime('InelasticIndirectReduction')
-
 
     def validateInputs(self):
         """
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MSGDiffractionReduction.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MSGDiffractionReduction.py
index 73e8140748acaa31165604c67f7784010f430bcc..ca4277dad752be530a67fd6c9b9c0b604bce23d4 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MSGDiffractionReduction.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MSGDiffractionReduction.py
@@ -77,11 +77,8 @@ class MSGDiffractionReduction(PythonAlgorithm):
 
 
     def PyExec(self):
-        from IndirectCommon import StartTime, EndTime
         from IndirectDiffractionReduction import MSGDiffractionReducer
 
-        StartTime('MSGDiffractionReduction')
-
         input_files = self.getProperty('InputFiles').value
         sum_files = self.getProperty('SumFiles').value
         individual_grouping = self.getProperty('IndividualGrouping').value
@@ -119,7 +116,5 @@ class MSGDiffractionReduction(PythonAlgorithm):
         GroupWorkspaces(InputWorkspaces=result_ws_list, OutputWorkspace=output_ws_group)
         self.setProperty('OutputWorkspace', output_ws_group)
 
-        EndTime('MSGDiffractionReduction')
-
 
 AlgorithmFactory.subscribe(MSGDiffractionReduction)
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/dnsdata.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/dnsdata.py
new file mode 100644
index 0000000000000000000000000000000000000000..97f14ac5e68d1f33ac83c597dc64808f1980f0f3
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/dnsdata.py
@@ -0,0 +1,213 @@
+import sys, re
+import datetime
+
+class DNSdata:
+    """
+    class which describes the DNS data structure
+    will be used for data read-in and write-out routines
+    """
+    def __init__(self):
+        self.title = ""
+        self.experiment_number = ""
+        self.run_number = ""
+        self.start_time = ""
+        self.end_time = ""
+        self.duration = None
+        self.deterota = 0
+        self.wavelength = None          # Angstrom
+        self.ndet = 24
+        self.sample_name = ""
+        self.userid = ""
+        self.user_name = ""
+        self.sample_description = ""
+        self.coil_status = ""
+        self.befilter_status = ""
+        self.notes = ""
+        self.monochromator_angle = None         # degree
+        self.monochromator_position = None
+        self.huber = None
+        self.cradle_lower = None
+        self.cradle_upper = None
+        self.slit_i_upper_blade_position = None
+        self.slit_i_lower_blade_position = None
+        self.slit_i_left_blade_position = None
+        self.slit_i_right_blade_position = None
+        self.slit_f_upper_blade_position = None
+        self.slit_f_lower_blade_position = None
+        self.detector_position_vertical = None
+        self.polarizer_translation = None
+        self.polarizer_rotation = None
+        self.flipper_precession_current = None
+        self.flipper_z_compensation_current = None
+        self.a_coil_current = None
+        self.b_coil_current = None
+        self.c_coil_current = None
+        self.z_coil_current = None
+        self.t1 = None       # T1
+        self.t2 = None       # T2
+        self.tsp = None      # T_setpoint
+        self.tof_channel_number = None
+        self.tof_channel_width = None
+        self.tof_delay_time = None
+        self.tof_elastic_channel = None
+        self.chopper_rotation_speed = None
+        self.chopper_slits = None
+        self.monitor_counts = None
+
+
+    def read_legacy(self, filename):
+        """
+        reads the DNS legacy ascii file into the DNS data object
+        """
+        with open(filename, 'r') as fhandler:
+            # read file content and split it into blocks
+            splitsymbol = \
+                    '#--------------------------------------------------------------------------'
+            unparsed = fhandler.read()
+            blocks = unparsed.split(splitsymbol)
+
+            # parse each block
+            # parse block 0 (header)
+            res = parse_header(blocks[0])
+            #if not res: raise Exception "wrong file format" else
+            try:
+                self.run_number = res['file']
+                self.experiment_number = res['exp']
+                self.sample_name = res['sample']
+                self.userid = res['userid']
+            except:
+                raise ValueError("The file %s does not contain valid DNS data format." % filename)
+            # parse block 1 (general information)
+            b1splitted = map(str.strip, blocks[1].split('#'))
+            b1rest = [el for el in b1splitted]
+            r_user = re.compile("User:\s*(?P<name>.*?$)")
+            r_sample = re.compile("Sample:\s*(?P<sample>.*?$)")
+            r_coil = re.compile("^(?P<coil>.*?)\s*xyz-coil.*")
+            r_filter = re.compile("^(?P<filter>.*?)\s*Be-filter.*")
+            for line in b1splitted:
+                res = r_user.match(line)
+                if res:
+                    self.user_name = res.group("name")
+                    b1rest.remove(line)
+                res = r_sample.match(line)
+                if res:
+                    self.sample_description = res.group("sample")
+                    b1rest.remove(line)
+                res = r_coil.match(line)
+                if res:
+                    self.coil_status = res.group("coil")
+                    b1rest.remove(line)
+                res = r_filter.match(line)
+                if res:
+                    self.befilter_status = res.group("filter")
+                    b1rest.remove(line)
+                # the rest unparsed lines go to notes for the moment
+                # [TODO]: parse more information about the sample
+                self.notes = ' '.join(b1rest)
+
+            # parse block 2 (wavelength and mochromator angle)
+            # for the moment, only theta and lambda are needed
+            b2splitted = map(str.strip, blocks[2].split('#'))
+            # assume that theta and lambda are always on the fixed positions
+            # assume theta is give in degree, lambda in nm
+            line = b2splitted[2].split()
+            self.monochromator_angle = float(line[2])
+            self.wavelength = float(line[3])*10.0
+
+            # parse block 3 (motors position)
+            b3splitted = map(str.strip, blocks[3].split('#'))
+            self.monochromator_position = float(b3splitted[2].split()[1])
+            # DeteRota, angle of rotation of detector bank
+            self.deterota = float(b3splitted[3].split()[1])
+            # Huber default units degree
+            self.huber = float(b3splitted[5].split()[1])
+            self.cradle_lower = float(b3splitted[6].split()[1])
+            self.cradle_upper = float(b3splitted[7].split()[1])
+            # Slit_i, convert mm to meter
+            self.slit_i_upper_blade_position = \
+                    0.001*float(b3splitted[9].split()[2])
+            self.slit_i_lower_blade_position = \
+                    0.001*float(b3splitted[10].split()[1])
+            self.slit_i_left_blade_position = \
+                    0.001*float(b3splitted[11].split()[2])
+            self.slit_i_right_blade_position = \
+                    0.001*float(b3splitted[12].split()[1])
+            # Slit_f
+            self.slit_f_upper_blade_position = \
+                    0.001*float(b3splitted[14].split()[1])
+            self.slit_f_lower_blade_position = \
+                    0.001*float(b3splitted[15].split()[1])
+            # Detector_position vertical
+            self.detector_position_vertical = \
+                    0.001*float(b3splitted[16].split()[1])
+            # Polarizer
+            self.polarizer_translation = \
+                    0.001*float(b3splitted[19].split()[1])
+            self.polarizer_rotation = float(b3splitted[20].split()[1])
+
+            # parse block 4 (B-fields), only currents in A are taken
+            b4splitted = map(str.strip, blocks[4].split('#'))
+            self.flipper_precession_current = float(b4splitted[2].split()[1])
+            self.flipper_z_compensation_current = float(b4splitted[3].split()[1])
+            self.a_coil_current = float(b4splitted[4].split()[1])
+            self.b_coil_current = float(b4splitted[5].split()[1])
+            self.c_coil_current = float(b4splitted[6].split()[1])
+            self.z_coil_current = float(b4splitted[7].split()[1])
+
+
+            # parse block 5 (Temperatures)
+            # assume: T1=cold_head_temperature, T2=sample_temperature
+            b5splitted = map(str.strip, blocks[5].split('#'))
+            self.t1 = float(b5splitted[2].split()[1])
+            self.t2 = float(b5splitted[3].split()[1])
+            self.tsp = float(b5splitted[4].split()[1])
+
+            # parse block 6 (TOF parameters)
+            b6splitted = map(str.strip, blocks[6].split('#'))
+            self.tof_channel_number = int(b6splitted[2].split()[2])
+            self.tof_channel_width = float(b6splitted[3].split()[3])
+            self.tof_delay_time = float(b6splitted[4].split()[2])
+            self.tof_elastic_channel = int(b6splitted[6].split()[3])
+            # chopper rotation speed
+            self.chopper_rotation_speed = float(b6splitted[7].split()[2])
+            # chopper number of slits
+            self.chopper_slits = int(b6splitted[5].split()[2])
+
+            # parse block 7 (Time and monitor)
+            # assume everything to be at the fixed positions
+            b7splitted = map(str.strip, blocks[7].split('#'))
+            # duration
+            line = b7splitted[2].split()
+            self.duration = float(line[1]) # assume seconds [TODO]: check
+            # monitor data
+            line = b7splitted[3].split()
+            self.monitor_counts = int(line[1])
+            # start_time and end_time
+            outfmt = "%Y-%m-%dT%H:%M:%S"
+            sinfmt = "start   at %a %b  %d %H:%M:%S %Y"
+            einfmt = "stopped at %a %b  %d %H:%M:%S %Y"
+            self.start_time = datetime.datetime.strptime(b7splitted[5], sinfmt).strftime(outfmt)
+            self.end_time = datetime.datetime.strptime(b7splitted[6], einfmt).strftime(outfmt)
+
+def parse_header(h):
+    """
+    parses the header string and returns the parsed dictionary
+    """
+    d = {}
+    regexp = re.compile("(\w+)=(\w+)")
+    result = regexp.finditer(h)
+    for r in result:
+        d[r.groups()[0]] = r.groups()[1]
+    return d
+
+
+if __name__ == '__main__':
+    fname = sys.argv[1]
+    dns_data = DNSdata()
+    dns_data.read_legacy(fname)
+    print dns_data.__dict__
+
+
+
+
+
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py
new file mode 100644
index 0000000000000000000000000000000000000000..581f3c7e413c935893d8e79bcba6f42cb0f58a52
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py
@@ -0,0 +1,118 @@
+import unittest
+from mantid.kernel import *
+from mantid.api import *
+from mantid.simpleapi import Load, ConvertUnits, SplineInterpolation, ApplyPaalmanPingsCorrection, DeleteWorkspace
+
+
+class ApplyPaalmanPingsCorrectionTest(unittest.TestCase):
+
+    def setUp(self):
+        """
+        Create sample workspaces.
+        """
+
+        # Load the sample and can
+        sample_ws = Load('irs26176_graphite002_red.nxs')
+        can_ws = Load('irs26173_graphite002_red.nxs')
+
+        # Convert sample and can to wavelength
+        sample_ws = ConvertUnits(InputWorkspace=sample_ws,
+                                 Target='Wavelength',
+                                 EMode='Indirect',
+                                 EFixed=1.845)
+        can_ws = ConvertUnits(InputWorkspace=can_ws,
+                              Target='Wavelength',
+                              EMode='Indirect',
+                              EFixed=1.845)
+
+        self._sample_ws = sample_ws
+        self._can_ws = can_ws
+
+        # Load the corrections workspace
+        corrections = Load('irs26176_graphite002_cyl_Abs.nxs')
+
+        # Interpolate each of the correction factor workspaces
+        # Required to use corrections from the old indirect calculate
+        # corrections routines
+        for factor_ws in corrections:
+            SplineInterpolation(WorkspaceToMatch=sample_ws,
+                                WorkspaceToInterpolate=factor_ws,
+                                OutputWorkspace=factor_ws,
+                                OutputWorkspaceDeriv='')
+
+        self._corrections_ws = corrections
+
+
+    def tearDown(self):
+        """
+        Remove workspaces from ADS.
+        """
+
+        DeleteWorkspace(self._sample_ws)
+        DeleteWorkspace(self._can_ws)
+        DeleteWorkspace(self._corrections_ws)
+
+
+    def _verify_workspace(self, ws, correction_type):
+        """
+        Do validation on a correction workspace.
+
+        @param ws Workspace to validate
+        @param correction_type Type of correction that should hav ebeen applied
+        """
+
+        # X axis should be in wavelength
+        x_unit = ws.getAxis(0).getUnit().unitID()
+        self.assertEquals(x_unit, 'Wavelength')
+
+        # Sample logs should contain correction type
+        logs = ws.getSampleDetails()
+        self.assertTrue('corrections_type' in logs)
+
+        # Ensure value from sample log is correct
+        if 'corrections_type' in logs:
+            log_correction_type = logs['corrections_type'].value
+            self.assertEqual(log_correction_type, correction_type)
+
+
+    def test_can_subtraction(self):
+        corr = ApplyPaalmanPingsCorrection(SampleWorkspace=self._sample_ws,
+                                           CanWorkspace=self._can_ws)
+
+        self._verify_workspace(corr, 'can_subtraction')
+
+
+    def test_can_subtraction_with_can_scale(self):
+        corr = ApplyPaalmanPingsCorrection(SampleWorkspace=self._sample_ws,
+                                           CanWorkspace=self._can_ws,
+                                           CanScaleFactor=0.9)
+
+        self._verify_workspace(corr, 'can_subtraction')
+
+
+    def test_sample_corrections_only(self):
+        corr = ApplyPaalmanPingsCorrection(SampleWorkspace=self._sample_ws,
+                                           CorrectionsWorkspace=self._corrections_ws)
+
+        self._verify_workspace(corr, 'sample_corrections_only')
+
+
+    def test_sample_and_can_corrections(self):
+        corr = ApplyPaalmanPingsCorrection(SampleWorkspace=self._sample_ws,
+                                           CorrectionsWorkspace=self._corrections_ws,
+                                           CanWorkspace=self._can_ws)
+
+        self._verify_workspace(corr, 'sample_and_can_corrections')
+
+
+    def test_sample_and_can_corrections_with_can_scale(self):
+        corr = ApplyPaalmanPingsCorrection(SampleWorkspace=self._sample_ws,
+                                           CorrectionsWorkspace=self._corrections_ws,
+                                           CanWorkspace=self._can_ws,
+                                           CanScaleFactor=0.9)
+
+        self._verify_workspace(corr, 'sample_and_can_corrections')
+
+
+if __name__=="__main__":
+    unittest.main()
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt
index c47909fcd6b99c77c21d07c5674d4ff7ae23656d..f1582a8b2e1e9be6eb6563f424cb8d6990f0c5dc 100644
--- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt
@@ -4,6 +4,7 @@
 
 set ( TEST_PY_FILES
   AddSampleLogMultipleTest.py
+  ApplyPaalmanPingsCorrectionTest.py
   CalculateSampleTransmissionTest.py
   CheckForSampleLogsTest.py
   ConjoinSpectraTest.py
@@ -26,6 +27,7 @@ set ( TEST_PY_FILES
   InelasticIndirectReductionTest.py
   IndirectTransmissionTest.py
   IndirectTransmissionMonitorTest.py
+  LoadDNSLegacyTest.py
   LoadFullprofFileTest.py
   LoadLiveDataTest.py
   LoadLogPropertyTableTest.py
@@ -57,6 +59,7 @@ set ( TEST_PY_FILES
   ExportExperimentLogTest.py
   PoldiMergeTest.py
   VesuvioResolutionTest.py
+  PoldiCreatePeaksFromFileTest.py
 )
 
 check_tests_valid ( ${CMAKE_CURRENT_SOURCE_DIR} ${TEST_PY_FILES} )
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/IndirectAnnulusAbsorptionTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/IndirectAnnulusAbsorptionTest.py
index 115a9f241e98ea38b8858ff85698a0f8c2c31001..c03efb8664f6fb7fe5e5e58d0da154664859a1c7 100644
--- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/IndirectAnnulusAbsorptionTest.py
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/IndirectAnnulusAbsorptionTest.py
@@ -17,22 +17,25 @@ class IndirectAnnulusAbsorptionTest(unittest.TestCase):
         self._red_ws = red_ws
 
 
-    def _test_workspaces(self, corrected, ass):
+    def _test_workspaces(self, corrected, factor_group):
         """
         Checks the units of the Ass and corrected workspaces.
 
         @param corrected Corrected workspace
-        @param ass Assc corrections workspace
+        @param factor_group WorkspaceGroup containing factors
         """
 
+        # Test units of corrected workspace
         corrected_x_unit = corrected.getAxis(0).getUnit().unitID()
         self.assertEqual(corrected_x_unit, 'DeltaE')
 
-        ass_x_unit = ass.getAxis(0).getUnit().unitID()
-        self.assertEquals(ass_x_unit, 'Wavelength')
+        # Test units of factor workspaces
+        for ws in factor_group:
+            x_unit = ws.getAxis(0).getUnit().unitID()
+            self.assertEquals(x_unit, 'Wavelength')
 
-        ass_y_unit = ass.YUnitLabel()
-        self.assertEqual(ass_y_unit, 'Attenuation factor')
+            y_unit = ws.YUnitLabel()
+            self.assertEqual(y_unit, 'Attenuation factor')
 
 
     def test_sample_corrections_only(self):
@@ -40,15 +43,13 @@ class IndirectAnnulusAbsorptionTest(unittest.TestCase):
         Tests corrections for the sample only.
         """
 
-        corrected, ass = IndirectAnnulusAbsorption(SampleWorkspace=self._red_ws,
-                                                   ChemicalFormula='H2-O',
-                                                   CanInnerRadius=0.2,
-                                                   SampleInnerRadius=0.15,
-                                                   SampleOuterRadius=0.16,
-                                                   CanOuterRadius=0.22,
-                                                   Events=200)
+        corrected, fact = IndirectAnnulusAbsorption(SampleWorkspace=self._red_ws,
+                                                    SampleChemicalFormula='H2-O',
+                                                    Events=200,
+                                                    UseCanCorrections=False)
 
-        self._test_workspaces(corrected, ass)
+        self.assertEqual(fact.size(), 1)
+        self._test_workspaces(corrected, fact)
 
 
     def test_sample_and_can_subtraction(self):
@@ -56,16 +57,14 @@ class IndirectAnnulusAbsorptionTest(unittest.TestCase):
         Tests corrections for the sample and simple container subtraction.
         """
 
-        corrected, ass = IndirectAnnulusAbsorption(SampleWorkspace=self._red_ws,
-                                                   CanWorkspace=self._can_ws,
-                                                   ChemicalFormula='H2-O',
-                                                   CanInnerRadius=0.2,
-                                                   SampleInnerRadius=0.15,
-                                                   SampleOuterRadius=0.16,
-                                                   CanOuterRadius=0.22,
-                                                   Events=200)
+        corrected, fact = IndirectAnnulusAbsorption(SampleWorkspace=self._red_ws,
+                                                    SampleChemicalFormula='H2-O',
+                                                    CanWorkspace=self._can_ws,
+                                                    Events=200,
+                                                    UseCanCorrections=False)
 
-        self._test_workspaces(corrected, ass)
+        self.assertEqual(fact.size(), 1)
+        self._test_workspaces(corrected, fact)
 
 
     def test_sample_and_can_subtraction_with_scale(self):
@@ -74,17 +73,32 @@ class IndirectAnnulusAbsorptionTest(unittest.TestCase):
         with can scale.
         """
 
-        corrected, ass = IndirectAnnulusAbsorption(SampleWorkspace=self._red_ws,
-                                                   CanWorkspace=self._can_ws,
-                                                   CanScaleFactor=0.8,
-                                                   ChemicalFormula='H2-O',
-                                                   CanInnerRadius=0.2,
-                                                   SampleInnerRadius=0.15,
-                                                   SampleOuterRadius=0.16,
-                                                   CanOuterRadius=0.22,
-                                                   Events=200)
-
-        self._test_workspaces(corrected, ass)
+        corrected, fact = IndirectAnnulusAbsorption(SampleWorkspace=self._red_ws,
+                                                    SampleChemicalFormula='H2-O',
+                                                    CanWorkspace=self._can_ws,
+                                                    CanScaleFactor=0.8,
+                                                    Events=200,
+                                                    UseCanCorrections=False)
+
+        self.assertEqual(fact.size(), 1)
+        self._test_workspaces(corrected, fact)
+
+
+    def test_sample_and_can_corrections(self):
+        """
+        Tests corrections for the sample and container.
+        """
+
+        corrected, fact = IndirectAnnulusAbsorption(SampleWorkspace=self._red_ws,
+                                                    SampleChemicalFormula='H2-O',
+                                                    CanWorkspace=self._can_ws,
+                                                    CanChemicalFormula='V',
+                                                    CanScaleFactor=0.8,
+                                                    Events=200,
+                                                    UseCanCorrections=True)
+
+        self.assertEqual(fact.size(), 2)
+        self._test_workspaces(corrected, fact)
 
 
 if __name__ == '__main__':
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/IndirectCylinderAbsorptionTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/IndirectCylinderAbsorptionTest.py
index d97057f84b35b200c284825f0ce5bfb3910f8023..cf422a7a7553bcb6b2b24f542ebda132d0b81102 100644
--- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/IndirectCylinderAbsorptionTest.py
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/IndirectCylinderAbsorptionTest.py
@@ -17,22 +17,25 @@ class IndirectCylinderAbsorptionTest(unittest.TestCase):
         self._red_ws = red_ws
 
 
-    def _test_workspaces(self, corrected, ass):
+    def _test_workspaces(self, corrected, factor_group):
         """
         Checks the units of the Ass and corrected workspaces.
 
         @param corrected Corrected workspace
-        @param ass Assc corrections workspace
+        @param factor_group WorkspaceGroup containing factors
         """
 
+        # Test units of corrected workspace
         corrected_x_unit = corrected.getAxis(0).getUnit().unitID()
         self.assertEqual(corrected_x_unit, 'DeltaE')
 
-        ass_x_unit = ass.getAxis(0).getUnit().unitID()
-        self.assertEquals(ass_x_unit, 'Wavelength')
+        # Test units of factor workspaces
+        for ws in factor_group:
+            x_unit = ws.getAxis(0).getUnit().unitID()
+            self.assertEquals(x_unit, 'Wavelength')
 
-        ass_y_unit = ass.YUnitLabel()
-        self.assertEqual(ass_y_unit, 'Attenuation factor')
+            y_unit = ws.YUnitLabel()
+            self.assertEqual(y_unit, 'Attenuation factor')
 
 
     def test_sample_corrections_only(self):
@@ -40,11 +43,12 @@ class IndirectCylinderAbsorptionTest(unittest.TestCase):
         Tests corrections for the sample only.
         """
 
-        corrected, ass = IndirectCylinderAbsorption(SampleWorkspace=self._red_ws,
-                                                    ChemicalFormula='H2-O',
-                                                    SampleRadius=0.2)
+        corrected, fact = IndirectCylinderAbsorption(SampleWorkspace=self._red_ws,
+                                                     SampleChemicalFormula='H2-O',
+                                                     Events=500)
 
-        self._test_workspaces(corrected, ass)
+        self.assertEqual(fact.size(), 1)
+        self._test_workspaces(corrected, fact)
 
 
     def test_sample_and_can_subtraction(self):
@@ -52,12 +56,14 @@ class IndirectCylinderAbsorptionTest(unittest.TestCase):
         Tests corrections for the sample and simple container subtraction.
         """
 
-        corrected, ass = IndirectCylinderAbsorption(SampleWorkspace=self._red_ws,
-                                                    CanWorkspace=self._can_ws,
-                                                    ChemicalFormula='H2-O',
-                                                    SampleRadius=0.2)
+        corrected, fact = IndirectCylinderAbsorption(SampleWorkspace=self._red_ws,
+                                                     CanWorkspace=self._can_ws,
+                                                     SampleChemicalFormula='H2-O',
+                                                     UseCanCorrections=False,
+                                                     Events=500)
 
-        self._test_workspaces(corrected, ass)
+        self.assertEqual(fact.size(), 1)
+        self._test_workspaces(corrected, fact)
 
 
     def test_sample_and_can_subtraction_with_scale(self):
@@ -66,13 +72,31 @@ class IndirectCylinderAbsorptionTest(unittest.TestCase):
         with can scale.
         """
 
-        corrected, ass = IndirectCylinderAbsorption(SampleWorkspace=self._red_ws,
-                                                    CanWorkspace=self._can_ws,
-                                                    CanScaleFactor=0.8,
-                                                    ChemicalFormula='H2-O',
-                                                    SampleRadius=0.2)
+        corrected, fact = IndirectCylinderAbsorption(SampleWorkspace=self._red_ws,
+                                                     CanWorkspace=self._can_ws,
+                                                     CanScaleFactor=0.8,
+                                                     SampleChemicalFormula='H2-O',
+                                                     UseCanCorrections=False,
+                                                     Events=500)
 
-        self._test_workspaces(corrected, ass)
+        self.assertEqual(fact.size(), 1)
+        self._test_workspaces(corrected, fact)
+
+
+    def test_sample_and_can_corrections(self):
+        """
+        Tests corrections for the sample and container.
+        """
+
+        corrected, fact = IndirectCylinderAbsorption(SampleWorkspace=self._red_ws,
+                                                     CanWorkspace=self._can_ws,
+                                                     SampleChemicalFormula='H2-O',
+                                                     CanChemicalFormula='V',
+                                                     UseCanCorrections=True,
+                                                     Events=500)
+
+        self.assertEqual(fact.size(), 2)
+        self._test_workspaces(corrected, fact)
 
 
 if __name__ == '__main__':
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/IndirectFlatPlateAbsorptionTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/IndirectFlatPlateAbsorptionTest.py
index 829d8688e685f955632b17e9c86835d4557b4ab2..48a9dcc6c0621d335b9a1f93b6ac79b626a82754 100644
--- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/IndirectFlatPlateAbsorptionTest.py
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/IndirectFlatPlateAbsorptionTest.py
@@ -17,22 +17,25 @@ class IndirectFlatPlateAbsorptionTest(unittest.TestCase):
         self._red_ws = red_ws
 
 
-    def _test_workspaces(self, corrected, ass):
+    def _test_workspaces(self, corrected, factor_group):
         """
         Checks the units of the Ass and corrected workspaces.
 
         @param corrected Corrected workspace
-        @param ass Assc corrections workspace
+        @param factor_group WorkspaceGroup containing factors
         """
 
+        # Test units of corrected workspace
         corrected_x_unit = corrected.getAxis(0).getUnit().unitID()
         self.assertEqual(corrected_x_unit, 'DeltaE')
 
-        ass_x_unit = ass.getAxis(0).getUnit().unitID()
-        self.assertEquals(ass_x_unit, 'Wavelength')
+        # Test units of factor workspaces
+        for ws in factor_group:
+            x_unit = ws.getAxis(0).getUnit().unitID()
+            self.assertEquals(x_unit, 'Wavelength')
 
-        ass_y_unit = ass.YUnitLabel()
-        self.assertEqual(ass_y_unit, 'Attenuation factor')
+            y_unit = ws.YUnitLabel()
+            self.assertEqual(y_unit, 'Attenuation factor')
 
 
     def test_sample_corrections_only(self):
@@ -40,14 +43,12 @@ class IndirectFlatPlateAbsorptionTest(unittest.TestCase):
         Tests corrections for the sample only.
         """
 
-        corrected, ass = IndirectFlatPlateAbsorption(SampleWorkspace=self._red_ws,
-                                                     ChemicalFormula='H2-O',
-                                                     SampleHeight=1,
-                                                     SampleWidth=1,
-                                                     SampleThickness=1,
-                                                     ElementSize=1)
+        corrected, fact = IndirectFlatPlateAbsorption(SampleWorkspace=self._red_ws,
+                                                      SampleChemicalFormula='H2-O',
+                                                      ElementSize=1)
 
-        self._test_workspaces(corrected, ass)
+        self.assertEqual(fact.size(), 1)
+        self._test_workspaces(corrected, fact)
 
 
     def test_sample_and_can_subtraction(self):
@@ -55,15 +56,14 @@ class IndirectFlatPlateAbsorptionTest(unittest.TestCase):
         Tests corrections for the sample and simple container subtraction.
         """
 
-        corrected, ass = IndirectFlatPlateAbsorption(SampleWorkspace=self._red_ws,
-                                                     CanWorkspace=self._can_ws,
-                                                     ChemicalFormula='H2-O',
-                                                     SampleHeight=1,
-                                                     SampleWidth=1,
-                                                     SampleThickness=1,
-                                                     ElementSize=1)
+        corrected, fact = IndirectFlatPlateAbsorption(SampleWorkspace=self._red_ws,
+                                                      SampleChemicalFormula='H2-O',
+                                                      CanWorkspace=self._can_ws,
+                                                      ElementSize=1,
+                                                      UseCanCorrections=False)
 
-        self._test_workspaces(corrected, ass)
+        self.assertEqual(fact.size(), 1)
+        self._test_workspaces(corrected, fact)
 
 
     def test_sample_and_can_subtraction_with_scale(self):
@@ -72,16 +72,31 @@ class IndirectFlatPlateAbsorptionTest(unittest.TestCase):
         with can scale.
         """
 
-        corrected, ass = IndirectFlatPlateAbsorption(SampleWorkspace=self._red_ws,
-                                                     CanWorkspace=self._can_ws,
-                                                     CanScaleFactor=0.8,
-                                                     ChemicalFormula='H2-O',
-                                                     SampleHeight=1,
-                                                     SampleWidth=1,
-                                                     SampleThickness=1,
-                                                     ElementSize=1)
+        corrected, fact = IndirectFlatPlateAbsorption(SampleWorkspace=self._red_ws,
+                                                      SampleChemicalFormula='H2-O',
+                                                      CanWorkspace=self._can_ws,
+                                                      CanScaleFactor=0.8,
+                                                      ElementSize=1,
+                                                      UseCanCorrections=False)
 
-        self._test_workspaces(corrected, ass)
+        self.assertEqual(fact.size(), 1)
+        self._test_workspaces(corrected, fact)
+
+
+    def test_sample_and_can_correction(self):
+        """
+        Tests corrections for the sample and container.
+        """
+
+        corrected, fact = IndirectFlatPlateAbsorption(SampleWorkspace=self._red_ws,
+                                                      SampleChemicalFormula='H2-O',
+                                                      CanWorkspace=self._can_ws,
+                                                      CanChemicalFormula='V',
+                                                      ElementSize=1,
+                                                      UseCanCorrections=True)
+
+        self.assertEqual(fact.size(), 2)
+        self._test_workspaces(corrected, fact)
 
 
 if __name__ == '__main__':
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadDNSLegacyTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadDNSLegacyTest.py
new file mode 100644
index 0000000000000000000000000000000000000000..bf8977363dcbcd8fb2e2e425c124506a69166619
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadDNSLegacyTest.py
@@ -0,0 +1,40 @@
+from mantid.kernel import *
+import mantid.simpleapi as api
+import unittest
+from testhelpers import run_algorithm
+from mantid.api import AnalysisDataService
+from math import pi
+
+
+class LoadDNSLegacyTest(unittest.TestCase):
+
+    def test_LoadValidData(self):
+        outputWorkspaceName = "LoadDNSLegacyTest_Test1"
+        filename = "dn134011vana.d_dat"
+        alg_test = run_algorithm("LoadDNSLegacy", Filename = filename, \
+                OutputWorkspace = outputWorkspaceName)
+                
+        self.assertTrue(alg_test.isExecuted())
+        
+        #Verify some values
+        ws = AnalysisDataService.retrieve(outputWorkspaceName)
+        # dimensions
+        self.assertEqual(24, ws.getNumberHistograms())
+        self.assertEqual(2,  ws.getNumDims())
+        # data array
+        self.assertEqual(31461, ws.readY(1))
+        self.assertEqual(13340, ws.readY(23))
+        # sample logs
+        logs = ws.getRun().getLogData()
+        self.assertEqual('deterota', logs[4].name)
+        self.assertEqual(-8.54, logs[4].value)
+        # check whether detector bank is rotated
+        samplePos = ws.getInstrument().getSample().getPos()
+        beamDirection = V3D(0,0,1)
+        det = ws.getDetector(1)
+        self.assertAlmostEqual(8.54, det.getTwoTheta(samplePos, beamDirection)*180/pi)
+        run_algorithm("DeleteWorkspace", Workspace = outputWorkspaceName)
+        return
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/PoldiCreatePeaksFromFileTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/PoldiCreatePeaksFromFileTest.py
new file mode 100644
index 0000000000000000000000000000000000000000..0e994d3f140e0746368a030d1676474d967ff8ac
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/PoldiCreatePeaksFromFileTest.py
@@ -0,0 +1,173 @@
+# pylint: disable=no-init,invalid-name,too-many-public-methods
+import unittest
+from testhelpers import assertRaisesNothing
+from testhelpers.tempfile_wrapper import TemporaryFileHelper
+
+from mantid.kernel import *
+from mantid.api import *
+from mantid.simpleapi import *
+
+class PoldiCreatePeaksFromFileTest(unittest.TestCase):
+    testname = None
+
+    def __init__(self, *args):
+        unittest.TestCase.__init__(self, *args)
+
+    def test_Init(self):
+        assertRaisesNothing(self, AlgorithmManager.create, ("PoldiCreatePeaksFromFile"))
+
+    def test_FileOneCompoundOneAtom(self):
+        fileHelper = TemporaryFileHelper("""Silicon {
+                                                Lattice: 5.43 5.43 5.43 90.0 90.0 90.0
+                                                Spacegroup: F d -3 m
+                                                Atoms: {
+                                                    Si 0 0 0 1.0 0.05
+                                                }
+                                            }""")
+        ws = PoldiCreatePeaksFromFile(fileHelper.getName(), 0.7, 10.0)
+
+        # Check output GroupWorkspace
+        self.assertEquals(ws.getNumberOfEntries(), 1)
+        self.assertTrue(ws.contains("Silicon"))
+
+        # Check that the ouput is identical to what's expected
+        ws_expected = PoldiCreatePeaksFromCell("F d -3 m", "Si 0 0 0 1.0 0.05", a=5.43, LatticeSpacingMin=0.7)
+        si_ws = AnalysisDataService.retrieve("Silicon")
+        self._tablesAreEqual(si_ws, ws_expected)
+
+        # Clean up
+        self._cleanWorkspaces([ws, ws_expected])
+
+    def test_FileOneCompoundTwoAtoms(self):
+        # It's the same structure and the same reflections, just the structure factors are different
+        fileHelper = TemporaryFileHelper("""SiliconCarbon {
+                                                Lattice: 5.43 5.43 5.43 90.0 90.0 90.0
+                                                Spacegroup: F d -3 m
+                                                Atoms: {
+                                                    Si 0 0 0 0.9 0.05
+                                                    C 0 0 0 0.1 0.05
+                                                }
+                                                # Comment
+                                            }""")
+        ws = PoldiCreatePeaksFromFile(fileHelper.getName(), 0.7, 10.0)
+
+        self.assertEquals(ws.getNumberOfEntries(), 1)
+        self.assertTrue(ws.contains("SiliconCarbon"))
+
+        ws_expected = PoldiCreatePeaksFromCell("F d -3 m", "Si 0 0 0 0.9 0.05; C 0 0 0 0.1 0.05", a=5.43,
+                                               LatticeSpacingMin=0.7)
+        si_ws = AnalysisDataService.retrieve("SiliconCarbon")
+        self._tablesAreEqual(si_ws, ws_expected)
+
+        # Clean up
+        self._cleanWorkspaces([ws, ws_expected])
+
+    def test_FileTwoCompounds(self):
+        # It's the same structure and the same reflections, just the structure factors are different
+        fileHelper = TemporaryFileHelper("""SiliconCarbon {
+                                                Lattice: 5.43 5.43 5.43 90.0 90.0 90.0
+                                                Spacegroup: F d -3 m
+                                                Atoms: {
+                                                    Si 0 0 0 0.9 0.05
+                                                    C 0 0 0 0.1 0.05
+                                                }
+                                            }
+                                            Silicon {
+                                                Lattice: 5.43 5.43 5.43 90.0 90.0 90.0
+                                                Spacegroup: F d -3 m
+                                                Atoms: {
+                                                    Si 0 0 0 1.0 0.05
+                                                }
+                                            }""")
+        ws = PoldiCreatePeaksFromFile(fileHelper.getName(), 0.7, 10.0)
+
+        self.assertEquals(ws.getNumberOfEntries(), 2)
+        self.assertTrue(ws.contains("SiliconCarbon"))
+        self.assertTrue(ws.contains("Silicon"))
+
+        self._cleanWorkspaces([ws])
+
+    def test_FileFaultyLatticeStrings(self):
+        fhLatticeMissing = TemporaryFileHelper("""Silicon {
+                                                    Spacegroup: F d -3 m
+                                                    Atoms: {
+                                                        Si 0 0 0 1.0 0.05
+                                                    }
+                                                  }""")
+
+        fhNoLattice = TemporaryFileHelper("""Silicon {
+                                                Lattice:
+                                                Spacegroup: F d -3 m
+                                                Atoms: {
+                                                    Si 0 0 0 1.0 0.05
+                                                }
+                                             }""")
+
+        fhInvalidLattice = TemporaryFileHelper("""Silicon {
+                                                    Lattice: invalid
+                                                    Spacegroup: F d -3 m
+                                                    Atoms: {
+                                                        Si 0 0 0 1.0 0.05
+                                                    }
+                                                  }""")
+
+        self.assertRaises(RuntimeError, PoldiCreatePeaksFromFile, *(fhLatticeMissing.getName(), 0.7, 10.0, 'ws'))
+        self.assertRaises(RuntimeError, PoldiCreatePeaksFromFile, *(fhNoLattice.getName(), 0.7, 10.0, 'ws'))
+        self.assertRaises(RuntimeError, PoldiCreatePeaksFromFile, *(fhInvalidLattice.getName(), 0.7, 10.0, 'ws'))
+
+
+    def test_FileFaultySpaceGroupStrings(self):
+        fhSgMissing = TemporaryFileHelper("""Silicon {
+                                                Lattice: 5.43 5.43 5.43 90.0 90.0 90.0
+                                                Atoms: {
+                                                    Si 0 0 0 1.0 0.05
+                                                }
+                                             }""")
+
+        fhSgInvalid = TemporaryFileHelper("""Silicon {
+                                                    Lattice: 5.43 5.43 5.43 90.0 90.0 90.0
+                                                    Spacegroup: invalid
+                                                    Atoms: {
+                                                        Si 0 0 0 1.0 0.05
+                                                    }
+                                                  }""")
+
+        self.assertRaises(RuntimeError, PoldiCreatePeaksFromFile, *(fhSgMissing.getName(), 0.7, 10.0, 'ws'))
+        self.assertRaises(RuntimeError, PoldiCreatePeaksFromFile, *(fhSgInvalid.getName(), 0.7, 10.0, 'ws'))
+
+    def test_FileFaultyAtomStrings(self):
+        fhAtomsMissing = TemporaryFileHelper("""Silicon {
+                                                Lattice: 5.43 5.43 5.43 90.0 90.0 90.0
+                                                Spacegroup: F d -3 m
+                                             }""")
+
+        fhAtomsNoBraces = TemporaryFileHelper("""Silicon {
+                                                    Lattice: 5.43 5.43 5.43 90.0 90.0 90.0
+                                                    Spacegroup: invalid
+                                                    Atoms:
+                                                        Sis 0 0 0 1.0 0.05
+                                                  }""")
+        fhAtomsEmpty = TemporaryFileHelper("""Silicon {
+                                                    Lattice: 5.43 5.43 5.43 90.0 90.0 90.0
+                                                    Spacegroup: invalid
+                                                    Atoms: { }
+                                                  }""")
+
+        self.assertRaises(RuntimeError, PoldiCreatePeaksFromFile, *(fhAtomsMissing.getName(), 0.7, 10.0, 'ws'))
+        self.assertRaises(RuntimeError, PoldiCreatePeaksFromFile, *(fhAtomsNoBraces.getName(), 0.7, 10.0, 'ws'))
+        self.assertRaises(RuntimeError, PoldiCreatePeaksFromFile, *(fhAtomsEmpty.getName(), 0.7, 10.0, 'ws'))
+
+
+    def _tablesAreEqual(self, lhs, rhs):
+        self.assertEquals(lhs.rowCount(), rhs.rowCount(), msg="Row count of tables is different")
+
+        for r in range(lhs.rowCount()):
+            self.assertEquals(lhs.row(r), rhs.row(r), "Row " + str(r) + " of tables differ.")
+
+    def _cleanWorkspaces(self, wsList):
+        for ws in wsList:
+            DeleteWorkspace(ws)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Code/Mantid/Framework/PythonInterface/test/testhelpers/CMakeLists.txt b/Code/Mantid/Framework/PythonInterface/test/testhelpers/CMakeLists.txt
index 8f778e77fbc5975e134ba5d1902da6a10c26d6e3..2b4c450e367550a6b658224a4f6832de28493281 100644
--- a/Code/Mantid/Framework/PythonInterface/test/testhelpers/CMakeLists.txt
+++ b/Code/Mantid/Framework/PythonInterface/test/testhelpers/CMakeLists.txt
@@ -5,6 +5,7 @@
 set ( PY_FILES
   __init__.py
   algorithm_decorator.py
+  tempfile_wrapper.py
 )
 
 # Copy python files to output directory
diff --git a/Code/Mantid/Framework/PythonInterface/test/testhelpers/WorkspaceCreationHelperModule.cpp b/Code/Mantid/Framework/PythonInterface/test/testhelpers/WorkspaceCreationHelperModule.cpp
index d99d2a14d4a7759d160758dbadc49b558e247aa6..1e243777f94a463c133dc2a4ba523b62544103a3 100644
--- a/Code/Mantid/Framework/PythonInterface/test/testhelpers/WorkspaceCreationHelperModule.cpp
+++ b/Code/Mantid/Framework/PythonInterface/test/testhelpers/WorkspaceCreationHelperModule.cpp
@@ -16,11 +16,11 @@
 using namespace WorkspaceCreationHelper;
 using namespace Mantid::DataObjects::MDEventsTestHelper;
 
-BOOST_PYTHON_FUNCTION_OVERLOADS(create2DWorkspaceWithFullInstrument_overloads, create2DWorkspaceWithFullInstrument, 2, 4);
+BOOST_PYTHON_FUNCTION_OVERLOADS(create2DWorkspaceWithFullInstrument_overloads, create2DWorkspaceWithFullInstrument, 2, 4)
 
-BOOST_PYTHON_FUNCTION_OVERLOADS(makeFakeMDHistoWorkspace_overloads, makeFakeMDHistoWorkspace, 2, 7);
+BOOST_PYTHON_FUNCTION_OVERLOADS(makeFakeMDHistoWorkspace_overloads, makeFakeMDHistoWorkspace, 2, 7)
 
-BOOST_PYTHON_FUNCTION_OVERLOADS(create2DWorkspaceWithRectangularInstrument_overloads, create2DWorkspaceWithRectangularInstrument, 3, 3);
+BOOST_PYTHON_FUNCTION_OVERLOADS(create2DWorkspaceWithRectangularInstrument_overloads, create2DWorkspaceWithRectangularInstrument, 3, 3)
 
 namespace
 {
diff --git a/Code/Mantid/Framework/PythonInterface/test/testhelpers/tempfile_wrapper.py b/Code/Mantid/Framework/PythonInterface/test/testhelpers/tempfile_wrapper.py
new file mode 100644
index 0000000000000000000000000000000000000000..b28413a026e0463066b80b6e46548049205d9651
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/test/testhelpers/tempfile_wrapper.py
@@ -0,0 +1,46 @@
+from tempfile import NamedTemporaryFile
+import os
+
+
+class TemporaryFileHelper(object):
+    """Helper class for temporary files in unit tests
+
+    This class is a small helper for using temporary files for unit test. On instantiation, a temporary file will be
+    created (using NamedTemporaryFile from the tempfile module). If the string argument to the constructor is not empty,
+    its content will be written to that file. The getName()-method provides the name of the temporary file, which can
+    for example be passed to an algorithm that expects a FileProperty. On destruction of the TemporaryFileHelper object,
+    the temporary file is removed automatically using os.unlink().
+
+    Usage:
+      emptyFileHelper = TemporaryFileHelper()
+      fh = open(emptyFileHelper.getName(), 'r+')
+      fh.write("Something or other\n")
+      fh.close()
+
+      filledFileHelper = TemporaryFileHelper("Something or other\n")
+      other = open(filledFileHelper.getName(), 'r')
+      for line in other:
+        print line
+      other.close()
+
+      del emptyFileHelper
+      del filledFileHelper
+    """
+    tempFile = None
+
+    def __init__(self, fileContent=""):
+        self.tempFile = NamedTemporaryFile('r+', delete=False)
+
+        if fileContent:
+            self._setFileContent(fileContent)
+
+    def __del__(self):
+        os.unlink(self.tempFile.name)
+
+    def getName(self):
+        return self.tempFile.name
+
+    def _setFileContent(self, content):
+        fileHandle = open(self.getName(), 'r+')
+        fileHandle.write(content)
+        fileHandle.close()
diff --git a/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h b/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h
index 7c28a976d88818788c3b7ec56c3c6f99e0c67fa1..fd87762b5bc5c04c21746fb3551e7f57641b9a0d 100644
--- a/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h
+++ b/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h
@@ -4,6 +4,7 @@
 #include "MantidSINQ/DllConfig.h"
 
 #include "MantidKernel/System.h"
+#include "MantidKernel/Unit.h"
 #include "MantidKernel/V2D.h"
 #include "MantidAPI/Algorithm.h"
 
@@ -93,11 +94,15 @@ protected:
 
   double
   minimumPeakHeightFromBackground(UncertainValue backgroundWithSigma) const;
+
+  double getTransformedCenter(double value,
+                              const Kernel::Unit_sptr &unit) const;
   std::vector<PoldiPeak_sptr>
   getPeaks(const MantidVec::const_iterator &baseListStart,
            const MantidVec::const_iterator &baseListEnd,
            std::list<MantidVec::const_iterator> peakPositions,
-           const MantidVec &xData) const;
+           const MantidVec &xData, const Kernel::Unit_sptr &unit) const;
+
   double getFWHMEstimate(const MantidVec::const_iterator &baseListStart,
                          const MantidVec::const_iterator &baseListEnd,
                          MantidVec::const_iterator peakPosition,
diff --git a/Code/Mantid/Framework/SINQ/src/PoldiIndexKnownCompounds.cpp b/Code/Mantid/Framework/SINQ/src/PoldiIndexKnownCompounds.cpp
index ee0bf9f4dd06b6e5444244bb6654d64cbf85350c..80eb0093d7374230935d6101b4f85b16292379c7 100644
--- a/Code/Mantid/Framework/SINQ/src/PoldiIndexKnownCompounds.cpp
+++ b/Code/Mantid/Framework/SINQ/src/PoldiIndexKnownCompounds.cpp
@@ -201,19 +201,25 @@ std::vector<Workspace_sptr> PoldiIndexKnownCompounds::getWorkspaces(
   std::vector<Workspace_sptr> workspaces;
 
   for (auto it = workspaceNames.begin(); it != workspaceNames.end(); ++it) {
-    Workspace_sptr currentWorkspace =
-        AnalysisDataService::Instance().retrieveWS<Workspace>(*it);
-
-    WorkspaceGroup_sptr groupTest =
-        boost::dynamic_pointer_cast<WorkspaceGroup>(currentWorkspace);
-    if (groupTest) {
-      std::vector<Workspace_sptr> workspacesNextLevel =
-          getWorkspaces(groupTest->getNames());
-
-      workspaces.insert(workspaces.end(), workspacesNextLevel.begin(),
-                        workspacesNextLevel.end());
-    } else {
-      workspaces.insert(workspaces.end(), currentWorkspace);
+    try {
+      Workspace_sptr currentWorkspace =
+          AnalysisDataService::Instance().retrieveWS<Workspace>(*it);
+
+      WorkspaceGroup_sptr groupTest =
+          boost::dynamic_pointer_cast<WorkspaceGroup>(currentWorkspace);
+      if (groupTest) {
+        std::vector<Workspace_sptr> workspacesNextLevel =
+            getWorkspaces(groupTest->getNames());
+
+        workspaces.insert(workspaces.end(), workspacesNextLevel.begin(),
+                          workspacesNextLevel.end());
+      } else {
+        workspaces.insert(workspaces.end(), currentWorkspace);
+      }
+    }
+    catch (Kernel::Exception::NotFoundError) {
+      Workspace_sptr invalid;
+      workspaces.insert(workspaces.end(), invalid);
     }
   }
 
@@ -719,8 +725,8 @@ void
 PoldiIndexKnownCompounds::assignPeakIndex(const IndexCandidatePair &candidate) {
   candidate.observed->setHKL(candidate.candidate->hkl());
 
-  m_indexedPeaks[candidate.candidateCollectionIndex]->addPeak(
-      candidate.observed);
+  m_indexedPeaks[candidate.candidateCollectionIndex]
+      ->addPeak(candidate.observed);
 }
 
 PoldiPeakCollection_sptr
diff --git a/Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp b/Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp
index 5c202387a0e5dd1efa97f3d9001a20df0efc91f2..384743a5834001d2a7d9368c82e3e26f5b1268c5 100644
--- a/Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp
+++ b/Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp
@@ -3,6 +3,8 @@
 #include "MantidAPI/WorkspaceProperty.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidKernel/BoundedValidator.h"
+#include "MantidKernel/UnitFactory.h"
+#include "MantidKernel/UnitConversion.h"
 #include "MantidKernel/V2D.h"
 
 #include "MantidDataObjects/Workspace2D.h"
@@ -197,6 +199,26 @@ PoldiPeakSearch::mapPeakPositionsToCorrelationData(
   return transformedIndices;
 }
 
+/// Converts the value-parameter to d-spacing. Assumes unit to be Q if empty.
+double PoldiPeakSearch::getTransformedCenter(double value,
+                                             const Unit_sptr &unit) const {
+  if (boost::dynamic_pointer_cast<Units::dSpacing>(unit)) {
+    return value;
+  }
+
+  // This is required to preserve default behavior which assumes Q.
+  Unit_sptr transformUnit = unit;
+
+  if (!unit || boost::dynamic_pointer_cast<Units::Empty>(unit)) {
+    transformUnit = UnitFactory::Instance().create("MomentumTransfer");
+  }
+
+  // Transform value to d-spacing.
+  Unit_sptr dUnit = UnitFactory::Instance().create("dSpacing");
+  return UnitConversion::run((*transformUnit), (*dUnit), value, 0, 0, 0,
+                             DeltaEMode::Elastic, 0.0);
+}
+
 /** Creates PoldiPeak-objects from peak position iterators
   *
   * In this method, PoldiPeak objects are created from the raw peak position
@@ -214,7 +236,7 @@ std::vector<PoldiPeak_sptr>
 PoldiPeakSearch::getPeaks(const MantidVec::const_iterator &baseListStart,
                           const MantidVec::const_iterator &baseListEnd,
                           std::list<MantidVec::const_iterator> peakPositions,
-                          const MantidVec &xData) const {
+                          const MantidVec &xData, const Unit_sptr &unit) const {
   std::vector<PoldiPeak_sptr> peakData;
   peakData.reserve(peakPositions.size());
 
@@ -223,11 +245,14 @@ PoldiPeakSearch::getPeaks(const MantidVec::const_iterator &baseListStart,
        peak != peakPositions.end(); ++peak) {
     size_t index = std::distance(baseListStart, *peak);
 
-    PoldiPeak_sptr newPeak =
-        PoldiPeak::create(UncertainValue(xData[index]), UncertainValue(**peak));
+    double xDataD = getTransformedCenter(xData[index], unit);
+
     double fwhmEstimate =
         getFWHMEstimate(baseListStart, baseListEnd, *peak, xData);
-    newPeak->setFwhm(UncertainValue(fwhmEstimate));
+    UncertainValue fwhm(fwhmEstimate / xData[index]);
+
+    PoldiPeak_sptr newPeak = PoldiPeak::create(
+        MillerIndices(), UncertainValue(xDataD), UncertainValue(**peak), fwhm);
     peakData.push_back(newPeak);
   }
 
@@ -536,6 +561,19 @@ void PoldiPeakSearch::exec() {
   MantidVec correlatedCounts = correlationWorkspace->readY(0);
   g_log.information() << "   Auto-correlation data read." << std::endl;
 
+  Unit_sptr xUnit = correlationWorkspace->getAxis(0)->unit();
+
+  if (xUnit->caption() == "") {
+    g_log.information()
+        << "   Workspace does not have unit, defaulting to MomentumTransfer."
+        << std::endl;
+
+    xUnit = UnitFactory::Instance().create("MomentumTransfer");
+  } else {
+    g_log.information() << "   Unit of workspace is " << xUnit->caption() << "."
+                        << std::endl;
+  }
+
   setMinimumDistance(getProperty("MinimumPeakSeparation"));
   setMinimumPeakHeight(getProperty("MinimumPeakHeight"));
   setMaximumPeakNumber(getProperty("MaximumPeakNumber"));
@@ -576,7 +614,7 @@ void PoldiPeakSearch::exec() {
    */
   std::vector<PoldiPeak_sptr> peakCoordinates =
       getPeaks(correlatedCounts.begin(), correlatedCounts.end(),
-               peakPositionsCorrelation, correlationQValues);
+               peakPositionsCorrelation, correlationQValues, xUnit);
   g_log.information()
       << "   Extracted peak positions in Q and intensity guesses." << std::endl;
 
diff --git a/Code/Mantid/Framework/SINQ/test/PoldiPeakSearchTest.h b/Code/Mantid/Framework/SINQ/test/PoldiPeakSearchTest.h
index 0674bd4c6375b2b38910c4fc3e967ac9fdf61a6f..17e0deeedab2c741315c454bc42bc3d4dda71f7d 100644
--- a/Code/Mantid/Framework/SINQ/test/PoldiPeakSearchTest.h
+++ b/Code/Mantid/Framework/SINQ/test/PoldiPeakSearchTest.h
@@ -6,6 +6,7 @@
 #include "MantidSINQ/PoldiPeakSearch.h"
 #include "MantidSINQ/PoldiUtilities/PoldiPeak.h"
 #include "MantidSINQ/PoldiUtilities/UncertainValue.h"
+#include "MantidKernel/UnitFactory.h"
 
 using Mantid::Poldi::PoldiPeakSearch;
 using namespace Mantid::Poldi;
@@ -133,7 +134,8 @@ public:
 
         maxima.sort();
 
-        std::vector<PoldiPeak_sptr> peaks = poldiPeakSearch.getPeaks(baseData.begin(), baseData.end(), maxima, testXData);
+        Unit_sptr qUnit = UnitFactory::Instance().create("MomentumTransfer");
+        std::vector<PoldiPeak_sptr> peaks = poldiPeakSearch.getPeaks(baseData.begin(), baseData.end(), maxima, testXData, qUnit);
 
         TS_ASSERT_EQUALS(peaks.size(), 4);
 
diff --git a/Code/Mantid/Framework/ScriptRepository/inc/MantidScriptRepository/ScriptRepositoryImpl.h b/Code/Mantid/Framework/ScriptRepository/inc/MantidScriptRepository/ScriptRepositoryImpl.h
index 64c0750492af73686b09a62ad8d52f4a73ec6a32..89900eeee1bc8c86bf24cc4279c7b31346707ce7 100644
--- a/Code/Mantid/Framework/ScriptRepository/inc/MantidScriptRepository/ScriptRepositoryImpl.h
+++ b/Code/Mantid/Framework/ScriptRepository/inc/MantidScriptRepository/ScriptRepositoryImpl.h
@@ -171,7 +171,7 @@ private:
   std::string getParentFolder(const std::string &entry);
 };
 
-}; // namespace API
-}; // namespace Mantid
+} // namespace API
+} // namespace Mantid
 
 #endif // _MANTIDSCRIPTREPOSITORY_SCRIPTREPOSITORYIMPL_H_
diff --git a/Code/Mantid/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp b/Code/Mantid/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp
index 1f0f1ea817597f809039d4340ac5d1f7a97e68ee..a3e8d448ce089acc0659ae09e99d0ad10a274887 100644
--- a/Code/Mantid/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp
+++ b/Code/Mantid/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp
@@ -1200,7 +1200,7 @@ void ScriptRepositoryImpl::setIgnorePatterns(const std::string &patterns) {
     boost::replace_all(newignore, "*", ".*");
     ignoreregex = std::string("(").append(newignore).append(")");
   }
-};
+}
 /**
  @todo describe
  */
diff --git a/Code/Mantid/Framework/TestHelpers/src/ScopedFileHelper.cpp b/Code/Mantid/Framework/TestHelpers/src/ScopedFileHelper.cpp
index e8708decc761fd33dcb5f77262662b8284c64535..243f36ff1373812ac60dfe73e8370baf3ff459b3 100644
--- a/Code/Mantid/Framework/TestHelpers/src/ScopedFileHelper.cpp
+++ b/Code/Mantid/Framework/TestHelpers/src/ScopedFileHelper.cpp
@@ -41,13 +41,13 @@ ScopedFile &ScopedFile::operator=(const ScopedFile &other) {
     other.release();
   }
   return *this;
-};
+}
 
 /// Copy construction.
 ScopedFile::ScopedFile(const ScopedFile &other) {
   this->m_filename = other.m_filename;
   other.release();
-};
+}
 
 /**
 Common method used by all constructors. Creates a file containing the ASCII file
diff --git a/Code/Mantid/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp b/Code/Mantid/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp
index 11df5295a6c60220911a920e59a2c1d0d462533f..1b5c6875f770090cd9cdbea871d42df51eee2907 100644
--- a/Code/Mantid/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp
+++ b/Code/Mantid/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp
@@ -81,10 +81,8 @@ Workspace2D_sptr Create1DWorkspaceConstant(int size, double value,
                                            double error) {
   MantidVecPtr x1, y1, e1;
   x1.access().resize(size, 1);
-  y1.access().resize(size);
-  std::fill(y1.access().begin(), y1.access().end(), value);
-  e1.access().resize(size);
-  std::fill(y1.access().begin(), y1.access().end(), error);
+  y1.access().resize(size, value);
+  e1.access().resize(size, error);
   Workspace2D_sptr retVal(new Workspace2D);
   retVal->initialize(1, size, size);
   retVal->setX(0, x1);
diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsAbsoluteUnitsReduction.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsAbsoluteUnitsReduction.cpp
index f8cff1c7562e38cfb885b61f1393a8173b0b50df..7f146efc89ad7d23b531f94bc08b2657bd88657f 100644
--- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsAbsoluteUnitsReduction.cpp
+++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsAbsoluteUnitsReduction.cpp
@@ -30,10 +30,10 @@ DgsAbsoluteUnitsReduction::~DgsAbsoluteUnitsReduction() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string DgsAbsoluteUnitsReduction::name() const {
   return "DgsAbsoluteUnitsReduction";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int DgsAbsoluteUnitsReduction::version() const { return 1; };
+int DgsAbsoluteUnitsReduction::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string DgsAbsoluteUnitsReduction::category() const {
diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp
index 9b5d8f18600fb99474fbdfe947680be892da075d..643c68fa0c224c341f035d3ac669c0a0104e56e9 100644
--- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp
+++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp
@@ -42,10 +42,10 @@ DgsConvertToEnergyTransfer::~DgsConvertToEnergyTransfer() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string DgsConvertToEnergyTransfer::name() const {
   return "DgsConvertToEnergyTransfer";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int DgsConvertToEnergyTransfer::version() const { return 1; };
+int DgsConvertToEnergyTransfer::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string DgsConvertToEnergyTransfer::category() const {
diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsDiagnose.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsDiagnose.cpp
index bbb21dc2cd5966b8a6b99900dc9b424707823ae7..85be54fcfc2f12d3df4d986d62c863e105129ceb 100644
--- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsDiagnose.cpp
+++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsDiagnose.cpp
@@ -30,10 +30,10 @@ DgsDiagnose::~DgsDiagnose() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string DgsDiagnose::name() const { return "DgsDiagnose"; };
+const std::string DgsDiagnose::name() const { return "DgsDiagnose"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int DgsDiagnose::version() const { return 1; };
+int DgsDiagnose::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string DgsDiagnose::category() const {
diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsPreprocessData.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsPreprocessData.cpp
index 56bce546f2d61b35d41df7314cfe0e8c558f7d26..56258b060d0b10e28f0dc52aa4f9db294585e850 100644
--- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsPreprocessData.cpp
+++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsPreprocessData.cpp
@@ -38,10 +38,10 @@ DgsPreprocessData::~DgsPreprocessData() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string DgsPreprocessData::name() const {
   return "DgsPreprocessData";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int DgsPreprocessData::version() const { return 1; };
+int DgsPreprocessData::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string DgsPreprocessData::category() const {
diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp
index 0b8a08209705c234b81399a3c2d047b8e3ae4f0c..f5dc93a0b54af726d6f691f35301b14b0cf34805 100644
--- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp
+++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp
@@ -39,10 +39,10 @@ DgsReduction::~DgsReduction() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string DgsReduction::name() const { return "DgsReduction"; };
+const std::string DgsReduction::name() const { return "DgsReduction"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int DgsReduction::version() const { return 1; };
+int DgsReduction::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string DgsReduction::category() const {
diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsRemap.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsRemap.cpp
index 5a15d54b2679ffd17b6f31f199312f8becaa16d7..d4008ae2aa53c2bde7d76394a911d1c4debca0f0 100644
--- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsRemap.cpp
+++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsRemap.cpp
@@ -24,10 +24,10 @@ DgsRemap::~DgsRemap() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string DgsRemap::name() const { return "DgsRemap"; };
+const std::string DgsRemap::name() const { return "DgsRemap"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int DgsRemap::version() const { return 1; };
+int DgsRemap::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string DgsRemap::category() const { return "Workflow\\Inelastic"; }
diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonCalculateAsymmetry.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonCalculateAsymmetry.cpp
index a508a720150ca85d6747ab2f6393528ea1905dad..a70b9f91146ecf4307042244bc3955785349db15 100644
--- a/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonCalculateAsymmetry.cpp
+++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonCalculateAsymmetry.cpp
@@ -28,10 +28,10 @@ MuonCalculateAsymmetry::~MuonCalculateAsymmetry() {}
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string MuonCalculateAsymmetry::name() const {
   return "MuonCalculateAsymmetry";
-};
+}
 
 /// Algorithm's version for identification. @see Algorithm::version
-int MuonCalculateAsymmetry::version() const { return 1; };
+int MuonCalculateAsymmetry::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string MuonCalculateAsymmetry::category() const {
diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonLoad.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonLoad.cpp
index 9d2771c1ea439e05c26d11828a179adf837c0311..0690f08d3c2c1650edbc0d70208a5c64bc81ed28 100644
--- a/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonLoad.cpp
+++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonLoad.cpp
@@ -28,10 +28,10 @@ MuonLoad::~MuonLoad() {}
 
 //----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string MuonLoad::name() const { return "MuonLoad"; };
+const std::string MuonLoad::name() const { return "MuonLoad"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int MuonLoad::version() const { return 1; };
+int MuonLoad::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string MuonLoad::category() const { return "Workflow\\Muon"; }
diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/StepScan.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/StepScan.cpp
index 616e1df5844f85a08a05f7f9772e6f911627486e..4541b25d6eae0ecaea86cc41b15ff4131c4a5bb3 100644
--- a/Code/Mantid/Framework/WorkflowAlgorithms/src/StepScan.cpp
+++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/StepScan.cpp
@@ -19,10 +19,10 @@ StepScan::StepScan() {}
 StepScan::~StepScan() {}
 
 /// Algorithm's name for identification. @see Algorithm::name
-const std::string StepScan::name() const { return "StepScan"; };
+const std::string StepScan::name() const { return "StepScan"; }
 
 /// Algorithm's version for identification. @see Algorithm::version
-int StepScan::version() const { return 1; };
+int StepScan::version() const { return 1; }
 
 /// Algorithm's category for identification. @see Algorithm::category
 const std::string StepScan::category() const { return "Workflow\\Alignment"; }
diff --git a/Code/Mantid/MantidPlot/CMakeLists.txt b/Code/Mantid/MantidPlot/CMakeLists.txt
index 68daaff89d6fdea488c03b40bf6bba8e2d9fcfac..6314b89a3f66c3453d7097e99b98e615f199154a 100644
--- a/Code/Mantid/MantidPlot/CMakeLists.txt
+++ b/Code/Mantid/MantidPlot/CMakeLists.txt
@@ -548,7 +548,7 @@ add_custom_command ( OUTPUT ${SIP_SRC}
 )
 
 # Needed for sip.h header that can end up in a different place to to the main Python include directory
-include_directories ( ${SIP_INCLUDE_DIR} )
+include_directories ( SYSTEM ${SIP_INCLUDE_DIR} )
 # Needed for sip generated files to find includes in src
 include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} )
 
diff --git a/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp b/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
index bff1921b0d3b2081eb73aa813d5898f851058513..e022a8b33290f6d83400ab7328144fd8886ed863 100644
--- a/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
+++ b/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
@@ -865,7 +865,7 @@ void ApplicationWindow::initGlobalConstants()
     d_locale.setNumberOptions(QLocale::OmitGroupSeparator);
 
   d_decimal_digits = 13;
-  d_graphing_digits = 3;
+  d_graphing_digits = 13;
 
   d_extended_open_dialog = true;
   d_extended_export_dialog = true;
diff --git a/Code/Mantid/MantidPlot/src/ExpDecayDialog.cpp b/Code/Mantid/MantidPlot/src/ExpDecayDialog.cpp
index 98154dc22ff8b7800e14888a1b373fa0ac4b8df8..cd334774930596a9e2ad7d8cbcd8430a8b3a7c98 100644
--- a/Code/Mantid/MantidPlot/src/ExpDecayDialog.cpp
+++ b/Code/Mantid/MantidPlot/src/ExpDecayDialog.cpp
@@ -158,7 +158,7 @@ void ExpDecayDialog::setGraph(Graph *g)
 
 	connect (graph, SIGNAL(closedGraph()), this, SLOT(close()));
     connect (graph, SIGNAL(dataRangeChanged()), this, SLOT(changeDataRange()));
-};
+}
 
 void ExpDecayDialog::activateCurve(const QString& curveName)
 {
@@ -178,7 +178,7 @@ void ExpDecayDialog::activateCurve(const QString& curveName)
 	if (slopes < 2)
         boxAmplitude->setText(QString::number(c->maxYValue() - c->minYValue(), 'g', precision));
 
-};
+}
 
 void ExpDecayDialog::changeDataRange()
 {
diff --git a/Code/Mantid/MantidPlot/src/FFTDialog.cpp b/Code/Mantid/MantidPlot/src/FFTDialog.cpp
index f83ac4f22c94e60de847057e6f982c4a845bb9f2..e6453e17b295abed8ce016b5b28113ba64a95f78 100644
--- a/Code/Mantid/MantidPlot/src/FFTDialog.cpp
+++ b/Code/Mantid/MantidPlot/src/FFTDialog.cpp
@@ -186,7 +186,7 @@ void FFTDialog::setGraph(Graph *g)
 	graph = g;
 	boxName->insertStringList (g->analysableCurvesList());
 	activateCurve(boxName->currentText());
-};
+}
 
 void FFTDialog::activateCurve(const QString& curveName)
 {
@@ -202,7 +202,7 @@ void FFTDialog::activateCurve(const QString& curveName)
 		double x1 = d_table->text(1, col).toDouble();
 		boxSampling->setText(QString::number(x1 - x0));
 	}
-};
+}
 
 void FFTDialog::setTable(Table *t)
 {
@@ -233,7 +233,7 @@ void FFTDialog::setTable(Table *t)
 		boxReal->setCurrentItem(t->colIndex(l[0]));
 		boxImaginary->setCurrentItem(t->colIndex(l[1]));
 	}
-};
+}
 
 void FFTDialog::setMatrix(Matrix *m)
 {
diff --git a/Code/Mantid/MantidPlot/src/FilterDialog.cpp b/Code/Mantid/MantidPlot/src/FilterDialog.cpp
index 6f02ae0d0fef6314f841ba1f1c121adde771b645..1e16d247b5955fec9a51f950f9157c9d562713b1 100644
--- a/Code/Mantid/MantidPlot/src/FilterDialog.cpp
+++ b/Code/Mantid/MantidPlot/src/FilterDialog.cpp
@@ -190,4 +190,4 @@ void FilterDialog::setGraph(Graph *g)
 {
 graph = g;
 boxName->addItems (g->analysableCurvesList());
-};
+}
diff --git a/Code/Mantid/MantidPlot/src/FitDialog.cpp b/Code/Mantid/MantidPlot/src/FitDialog.cpp
index 27936290bc3adff94fda465ce20fcf4977fd11f5..701adfc599bcca9af0f282023c6a4f1078d60d6d 100644
--- a/Code/Mantid/MantidPlot/src/FitDialog.cpp
+++ b/Code/Mantid/MantidPlot/src/FitDialog.cpp
@@ -559,7 +559,7 @@ void FitDialog::setGraph(Graph *g)
 
 	connect (d_graph, SIGNAL(closedGraph()), this, SLOT(close()));
 	connect (d_graph, SIGNAL(dataRangeChanged()), this, SLOT(changeDataRange()));
-};
+}
 
 void FitDialog::activateCurve(const QString& curveName)
 {
@@ -573,7 +573,7 @@ void FitDialog::activateCurve(const QString& curveName)
     boxTo->setValue(QMAX(start, end));
 	//Set the same color as the data curve chosen for fit (Feature Request #4031)
 	boxColor->setColor(c->pen().color());
-};
+}
 
 void FitDialog::saveUserFunction()
 {
diff --git a/Code/Mantid/MantidPlot/src/Graph.cpp b/Code/Mantid/MantidPlot/src/Graph.cpp
index a36e9a89449c505d046e39a39f8c0d7b42b8bb12..92123c84c1bd6373f78c3468f2461ef7af8adf82 100644
--- a/Code/Mantid/MantidPlot/src/Graph.cpp
+++ b/Code/Mantid/MantidPlot/src/Graph.cpp
@@ -5360,9 +5360,11 @@ void Graph::enablePanningMagnifier(bool on)
     delete d_panner;
 
   QwtPlotCanvas *cnvs =d_plot->canvas(); //canvas();
-  if (on){
+  if (on) {
     cnvs->setCursor(Qt::pointingHandCursor);
     d_magnifier = new QwtPlotMagnifier(cnvs);
+    // Disable the mouse button as it causes issues with the context menu
+    d_magnifier->setMouseButton(Qt::NoButton);
     d_magnifier->setAxisEnabled(QwtPlot::yRight,false);
     d_magnifier->setZoomInKey(Qt::Key_Plus, Qt::ShiftModifier);
 
diff --git a/Code/Mantid/MantidPlot/src/Graph.h b/Code/Mantid/MantidPlot/src/Graph.h
index 07cab9df6848ce3f2ac8ab91b713e15e62845f1c..7480107f3b16f2e676788b11424dc8f16e71d71b 100644
--- a/Code/Mantid/MantidPlot/src/Graph.h
+++ b/Code/Mantid/MantidPlot/src/Graph.h
@@ -881,7 +881,7 @@ private:
 
 };
 
-Q_DECLARE_METATYPE(Graph::CurveType);
+Q_DECLARE_METATYPE(Graph::CurveType)
 
 
 #endif // GRAPH_H
diff --git a/Code/Mantid/MantidPlot/src/InterpolationDialog.cpp b/Code/Mantid/MantidPlot/src/InterpolationDialog.cpp
index 4d0ceb1722ec6edd74468697136ee4eae62f9823..efc62a720287db9a0bf84597b542da0dbd6d2852 100644
--- a/Code/Mantid/MantidPlot/src/InterpolationDialog.cpp
+++ b/Code/Mantid/MantidPlot/src/InterpolationDialog.cpp
@@ -173,7 +173,7 @@ void InterpolationDialog::setGraph(Graph *g)
 
 	connect (graph, SIGNAL(closedGraph()), this, SLOT(close()));
 	connect (graph, SIGNAL(dataRangeChanged()), this, SLOT(changeDataRange()));
-};
+}
 
 void InterpolationDialog::activateCurve(const QString& curveName)
 {
@@ -189,7 +189,7 @@ void InterpolationDialog::activateCurve(const QString& curveName)
 	graph->range(graph->curveIndex(curveName), &start, &end);
 	boxStart->setText(QString::number(QMIN(start, end), 'g', app->d_decimal_digits));
 	boxEnd->setText(QString::number(QMAX(start, end), 'g', app->d_decimal_digits));
-};
+}
 
 void InterpolationDialog::changeDataRange()
 {
diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.cpp
index 6caf14cffda807df66ff555893690b33b8148823..a2649437b34be4c7d7eff4d34b7b75be00ab5b4b 100644
--- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.cpp
+++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.cpp
@@ -17,7 +17,7 @@
 InstrumentTreeWidget::InstrumentTreeWidget(QWidget *w):QTreeView(w), m_treeModel(0) 
 {
   connect(this,SIGNAL(clicked(const QModelIndex)),this,SLOT(sendComponentSelectedSignal(const QModelIndex)));
-};
+}
 
 void InstrumentTreeWidget::setInstrumentActor(InstrumentActor* instrActor)
 {
diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp
index fb7636c0e7603ad382120028012a2ab1e726fa38..343c6551c4120d45acc8e47449eabf88d1806a7b 100644
--- a/Code/Mantid/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp
+++ b/Code/Mantid/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp
@@ -462,6 +462,7 @@ void MantidSampleLogDialog::init()
   m_tree->header()->resizeSection(3, 90); //units column
   m_tree->header()->setMovable(false);
   m_tree->setSortingEnabled(true);
+  m_tree->sortByColumn(0, Qt::AscendingOrder);
 }
 
 
diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp
index 2ef4c3335a4734ba153ddf208f75626cebf9bf3f..e3cbe352b68a1f12721380645eb4c6d909b5ec81 100644
--- a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp
+++ b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp
@@ -2310,7 +2310,7 @@ MultiLayer* MantidUI::mergePlots(MultiLayer* mlayer_1, MultiLayer* mlayer_2)
   mlayer_2->close();
 
   return mlayer_1;
-};
+}
 
 MantidMatrix* MantidUI::getMantidMatrix(const QString& wsName)
 {
@@ -2519,8 +2519,8 @@ void MantidUI::importNumSeriesLog(const QString &wsName, const QString &logName,
   {
     //Seconds offset
     t->setColName(0, "Time (sec)");
-    t->setColumnType(0, Table::Numeric); //six digits after 0
-    t->setNumericPrecision(6); //six digits after 0
+    t->setColumnType(0, Table::Numeric);
+    t->setNumericPrecision(16);   //it's the number of all digits
   }
 
   //Make the column header with the units, if any
@@ -2530,7 +2530,6 @@ void MantidUI::importNumSeriesLog(const QString &wsName, const QString &logName,
   t->setColName(1, column1);
 
   int iValueCurve = 0;
-  int iFilterCurve = 1;
 
   // Applying filters
   if (filter > 0)
@@ -2634,9 +2633,6 @@ void MantidUI::importNumSeriesLog(const QString &wsName, const QString &logName,
         }
       }
 
-      iValueCurve = 1;
-      iFilterCurve = 0;
-
     } //end (valid filter exists)
 
   }
@@ -2734,19 +2730,23 @@ void MantidUI::importNumSeriesLog(const QString &wsName, const QString &logName,
 
   if (filter && flt.filter())
   {
+    int iFilterCurve = 1;
     QwtPlotCurve *c = g->curve(iFilterCurve);
-    // Set the right axis as Y axis for the filter curve.
-    c->setAxis(2,1);
-    // Set style #3 (HorizontalSteps) for curve 1
-    // Set scale of right Y-axis (#3) from 0 to 1
-    g->setCurveStyle(iFilterCurve,3);
-    g->setScale(3,0,1);
-    // Fill area under the curve with a pattern
-    QBrush br = QBrush(Qt::gray, Qt::Dense5Pattern);
-    g->setCurveBrush(iFilterCurve, br);
-    // Set line colour
-    QPen pn = QPen(Qt::gray);
-    g->setCurvePen(iFilterCurve, pn);
+    if ( c )
+    {
+      // Set the right axis as Y axis for the filter curve.
+      c->setAxis(2,1);
+      // Set style #3 (HorizontalSteps) for curve 1
+      // Set scale of right Y-axis (#3) from 0 to 1
+      g->setCurveStyle(iFilterCurve,3);
+      g->setScale(3,0,1);
+      // Fill area under the curve with a pattern
+      QBrush br = QBrush(Qt::gray, Qt::Dense5Pattern);
+      g->setCurveBrush(iFilterCurve, br);
+      // Set line colour
+      QPen pn = QPen(Qt::gray);
+      g->setCurvePen(iFilterCurve, pn);
+    }
   }
   g->setXAxisTitle(t->colLabel(0));
   g->setYAxisTitle(t->colLabel(1).section(".",0,0));
diff --git a/Code/Mantid/MantidPlot/src/MdiSubWindow.cpp b/Code/Mantid/MantidPlot/src/MdiSubWindow.cpp
index 3e003d1b593fc70e9a2f28ad13d1e442b603f64a..f0b014fb79a82d2442d714e61ad0ded817581ada 100644
--- a/Code/Mantid/MantidPlot/src/MdiSubWindow.cpp
+++ b/Code/Mantid/MantidPlot/src/MdiSubWindow.cpp
@@ -98,7 +98,7 @@ void MdiSubWindow::updateCaption()
     wrapper->setWindowTitle(windowTitle());
   }
   emit captionChanged(objectName(), d_label);
-};
+}
 
 void MdiSubWindow::resizeEvent( QResizeEvent* e )
 {
diff --git a/Code/Mantid/MantidPlot/src/MultiLayer.h b/Code/Mantid/MantidPlot/src/MultiLayer.h
index e561a61a0fd4f9567bee65e89a9e8ab0c4d815c0..cba7586a9b750b181a036cff1dfaf046295f8308 100644
--- a/Code/Mantid/MantidPlot/src/MultiLayer.h
+++ b/Code/Mantid/MantidPlot/src/MultiLayer.h
@@ -266,7 +266,7 @@ signals:
 	void clicked(LayerButton*);
 };
 
-Q_DECLARE_METATYPE(MultiLayer*);
+Q_DECLARE_METATYPE(MultiLayer*)
 
 
 class WaterfallFillDialog : QDialog
diff --git a/Code/Mantid/MantidPlot/src/Plot3DDialog.cpp b/Code/Mantid/MantidPlot/src/Plot3DDialog.cpp
index f1cab9fe0ed10459a2f02bfe8adc2ed50db2a32f..a231acee361ea34a6fca21608b53fbc4ec1f0664 100644
--- a/Code/Mantid/MantidPlot/src/Plot3DDialog.cpp
+++ b/Code/Mantid/MantidPlot/src/Plot3DDialog.cpp
@@ -594,7 +594,7 @@ void Plot3DDialog::setPlot(Graph3D *g)
 	connect( boxLegend, SIGNAL(toggled(bool)), d_plot, SLOT(showColorLegend(bool)));
     connect( boxResolution, SIGNAL(valueChanged(int)), d_plot, SLOT(setResolution(int)));
 	connect( boxDistance, SIGNAL(valueChanged(int)), d_plot, SLOT(setLabelsDistance(int)));
-};
+}
 
 void Plot3DDialog::worksheet()
 {
diff --git a/Code/Mantid/MantidPlot/src/PlotDialog.h b/Code/Mantid/MantidPlot/src/PlotDialog.h
index f5e1d9017a55c6a0d674c07571a836d8ed58e960..bd58dfa8dfaaf4db744a12a1a0f60e2e29ede80f 100644
--- a/Code/Mantid/MantidPlot/src/PlotDialog.h
+++ b/Code/Mantid/MantidPlot/src/PlotDialog.h
@@ -181,7 +181,7 @@ private:
   ColorMapEditor *colorMapEditor;
   QPushButton* mSelectColormap;
   QString mCurrentColorMap;
-  QWidget *curvePlotTypeBox, *layerPage, *layerGeometryPage, *piePage, *fontsPage, *printPage, *contourLinesPage;;
+  QWidget *curvePlotTypeBox, *layerPage, *layerGeometryPage, *piePage, *fontsPage, *printPage, *contourLinesPage;
   QTreeWidget* listBox;
   QCheckBox *boxAntialiasing, *boxAll, *boxScaleLayers, *boxPrintCrops;
   ColorButton *boxBorderColor, *boxBackgroundColor, *boxCanvasColor, *boxCanvasFrameColor;
@@ -236,7 +236,7 @@ private:
   QLabel *boxRangeLabel, *whiskerCntLabel, *boxCntLabel;
   QGroupBox *GroupBoxVectEnd;
   QComboBox *vectPosBox, *boxXAxis, *boxYAxis, *colorScaleBox;//, *boxContourStyle;
-  PenStyleBox	*penContourStyle,*boxContourStyle;;
+  PenStyleBox	*penContourStyle,*boxContourStyle;
   QSpinBox *levelsBox, *colorScaleWidthBox;
   DoubleSpinBox *contourWidthBox;
   QGroupBox *levelsGroupBox, *axisScaleBox, *imageGroupBox;
diff --git a/Code/Mantid/MantidPlot/src/PluginFit.cpp b/Code/Mantid/MantidPlot/src/PluginFit.cpp
index 708994c0bbb4d94eb4b2fa8896499affaa8a54c0..7ca2fdbe6df82f93d1b97c2ba8e036374d4be53c 100644
--- a/Code/Mantid/MantidPlot/src/PluginFit.cpp
+++ b/Code/Mantid/MantidPlot/src/PluginFit.cpp
@@ -64,6 +64,39 @@ void PluginFit::init()
     d_fit_type = Plugin;
 }
 
+
+namespace{
+typedef union {
+  double (*func)(const gsl_vector *, void *);
+  void* ptr;
+} simplex_union;
+
+typedef union {
+  int (*func)(const gsl_vector *, void *, gsl_vector *);
+  void* ptr;
+} f_union;
+
+typedef union {
+  int (*func)(const gsl_vector *, void *,gsl_matrix *);
+  void* ptr;
+} df_union;
+
+typedef union {
+  int (*func)(const gsl_vector *, void *, gsl_vector *, gsl_matrix *);
+  void* ptr;
+} fdf_union;
+
+typedef union {
+  double (*func)(double, double *);
+  void* ptr;
+} ffe_union;
+
+typedef union {
+  char* (*func)();
+  void* ptr;
+} ff_union;
+}
+
 bool PluginFit::load(const QString& pluginName)
 {
 	if (!QFile::exists (pluginName)){
@@ -75,40 +108,52 @@ bool PluginFit::load(const QString& pluginName)
 	QLibrary lib(pluginName);
 	lib.setAutoUnload(false);
 
-	d_fsimplex = (fit_function_simplex) lib.resolve( "function_d" );
+	simplex_union simplex;
+        simplex.ptr = lib.resolve( "function_d" );
+        d_fsimplex = simplex.func;
 	if (!d_fsimplex){
 		QMessageBox::critical(static_cast<ApplicationWindow*>(parent()), tr("MantidPlot - Plugin Error"),
 				tr("The plugin does not implement a %1 method necessary for simplex fitting.").arg("function_d"));
 		return false;
 	}
 
-	d_f = (fit_function) lib.resolve( "function_f" );
+        f_union f;
+        f.ptr = lib.resolve( "function_f" );
+        d_f = f.func;
 	if (!d_f){
 		QMessageBox::critical(static_cast<ApplicationWindow*>(parent()), tr("MantidPlot - Plugin Error"),
 				tr("The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting.").arg("function_f"));
 		return false;
 	}
 
-	d_df = (fit_function_df) lib.resolve( "function_df" );
-	if (!d_df){
+        df_union df;
+        df.ptr = lib.resolve( "function_df" );
+	d_df = df.func;
+	if (!(df.ptr)){
 		QMessageBox::critical(static_cast<ApplicationWindow*>(parent()), tr("MantidPlot - Plugin Error"),
 				tr("The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting.").arg("function_df"));
 		return false;
 	}
 
-	d_fdf = (fit_function_fdf) lib.resolve( "function_fdf" );
+        fdf_union fdf;
+        fdf.ptr = lib.resolve( "function_fdf" );
+	d_fdf = fdf.func;
 	if (!d_fdf){
 		QMessageBox::critical(static_cast<ApplicationWindow*>(parent()), tr("MantidPlot - Plugin Error"),
 				tr("The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting.").arg("function_fdf"));
 		return false;
 	}
 
-	f_eval = (fitFunctionEval) lib.resolve("function_eval");
+        ffe_union ffe;
+        ffe.ptr = lib.resolve("function_eval");
+	f_eval = ffe.func;
 	if (!f_eval)
 		return false;
 
 	typedef char* (*fitFunc)();
-	fitFunc fitFunction = (fitFunc) lib.resolve("parameters");
+        ff_union ff;
+        ff.ptr = lib.resolve("parameters");
+	fitFunc fitFunction = ff.func;
 	if (fitFunction){
 		d_param_names = QString(fitFunction()).split(",", QString::SkipEmptyParts);
 		d_p = (int)d_param_names.count();
@@ -116,17 +161,20 @@ bool PluginFit::load(const QString& pluginName)
 	} else
 		return false;
 
-	fitFunc fitExplain = (fitFunc) lib.resolve("explanations");
+        ff.ptr = lib.resolve("explanations");
+	fitFunc fitExplain = ff.func;
 	if (fitExplain)
 		d_param_explain = QString(fitExplain()).split(",", QString::SkipEmptyParts);
 	else
 		for (int i=0; i<d_p; i++)
 			d_param_explain << "";
 
-	fitFunction = (fitFunc) lib.resolve( "name" );
+        ff.ptr = lib.resolve("name");
+	fitFunction = ff.func;
 	setObjectName(QString(fitFunction()));
 
-	fitFunction = (fitFunc) lib.resolve( "function" );
+        ff.ptr = lib.resolve("function");
+	fitFunction = ff.func;
 	if (fitFunction)
 		d_formula = QString(fitFunction());
 	else
diff --git a/Code/Mantid/MantidPlot/src/PolynomFitDialog.cpp b/Code/Mantid/MantidPlot/src/PolynomFitDialog.cpp
index ae9655bcc774897cf2dd33f27db9f87431a94236..f1e19dc48096b0edbdc3adcb1ea3f9b4651a67fa 100644
--- a/Code/Mantid/MantidPlot/src/PolynomFitDialog.cpp
+++ b/Code/Mantid/MantidPlot/src/PolynomFitDialog.cpp
@@ -146,7 +146,7 @@ void PolynomFitDialog::setGraph(Graph *g)
 
 	connect (graph, SIGNAL(closedGraph()), this, SLOT(close()));
 	connect (graph, SIGNAL(dataRangeChanged()), this, SLOT(changeDataRange()));
-};
+}
 
 void PolynomFitDialog::activateCurve(const QString& curveName)
 {
@@ -156,7 +156,7 @@ void PolynomFitDialog::activateCurve(const QString& curveName)
 	boxStart->setText(QString::number(start, 'g', 15));
 	boxEnd->setText(QString::number(end, 'g', 15));
 	boxPoints->setValue(QMAX(n_points, 100));
-};
+}
 
 void PolynomFitDialog::changeDataRange()
 {
diff --git a/Code/Mantid/MantidPlot/src/PythonScript.cpp b/Code/Mantid/MantidPlot/src/PythonScript.cpp
index 990bcbf2ab777dd7de3061ad244eab585c3400e0..6396aef2af399c082fa1611402faaeb6306965c2 100644
--- a/Code/Mantid/MantidPlot/src/PythonScript.cpp
+++ b/Code/Mantid/MantidPlot/src/PythonScript.cpp
@@ -686,7 +686,7 @@ namespace
     }
   private:
     InstallTrace();
-    Q_DISABLE_COPY(InstallTrace);
+    Q_DISABLE_COPY(InstallTrace)
     PyObject *m_sipWrappedScript;
   };
 }
diff --git a/Code/Mantid/MantidPlot/src/PythonThreading.h b/Code/Mantid/MantidPlot/src/PythonThreading.h
index 663b68568f40f0ae39b84d31aa67373f4596ef06..83a659aa76fca55f63209a32aed3285b7cf12194 100644
--- a/Code/Mantid/MantidPlot/src/PythonThreading.h
+++ b/Code/Mantid/MantidPlot/src/PythonThreading.h
@@ -18,7 +18,7 @@ struct GlobalInterpreterLock
     PyGILState_Release(m_state);
   }
 private:
-  Q_DISABLE_COPY(GlobalInterpreterLock);
+  Q_DISABLE_COPY(GlobalInterpreterLock)
   /// Current GIL state
   PyGILState_STATE m_state;
 };
diff --git a/Code/Mantid/MantidPlot/src/ScriptFileInterpreter.h b/Code/Mantid/MantidPlot/src/ScriptFileInterpreter.h
index 785f6119a25fe2b688b1409399942880adbc48aa..705efe9a4ebe730cd9e051e4285ef079cbc0ee3c 100644
--- a/Code/Mantid/MantidPlot/src/ScriptFileInterpreter.h
+++ b/Code/Mantid/MantidPlot/src/ScriptFileInterpreter.h
@@ -123,7 +123,7 @@ private slots:
   void setStoppedStatus();
 
 private:
-  Q_DISABLE_COPY(ScriptFileInterpreter);
+  Q_DISABLE_COPY(ScriptFileInterpreter)
   void setupChildWidgets();
 
   void setupEditor(const ScriptingEnv & environ, const QString & identifier);
diff --git a/Code/Mantid/MantidPlot/src/qti.sip b/Code/Mantid/MantidPlot/src/qti.sip
index 2d12a0cb2431f98d15c8afda373768a9d0009603..b241c862b0d93b5ec2ed9beecfc4e98f66d41c86 100644
--- a/Code/Mantid/MantidPlot/src/qti.sip
+++ b/Code/Mantid/MantidPlot/src/qti.sip
@@ -31,6 +31,12 @@
 
 %Module _qti
 
+%UnitCode
+  #if defined(__GNUC__) && !(defined(__INTEL_COMPILER))
+    #pragma GCC system_header
+  #endif
+%End
+
 %Import QtCore/QtCoremod.sip
 %Import QtGui/QtGuimod.sip
 %Import mantidqt.sip
diff --git a/Code/Mantid/MantidPlot/src/sipqti.cpp.in b/Code/Mantid/MantidPlot/src/sipqti.cpp.in
index 750399d6d8f9f43b7ead0aee905f0940246ccef5..b7661e1452641623eb1bc54378f8902f76850f3f 100644
--- a/Code/Mantid/MantidPlot/src/sipqti.cpp.in
+++ b/Code/Mantid/MantidPlot/src/sipqti.cpp.in
@@ -1,13 +1,7 @@
 //------------------------------------------------------------------------------
 // A wrapper for the auto-generated sipqtipart?.cpp files to disable warnings
-// that we can't control
+// that we can't control. The warnings are actually suppressed in qti.sip
+// with '#pragma GCC system_header' but that pragma only works if it occurs
+// in a file that has been included with '#include'
 //------------------------------------------------------------------------------
-#if defined(__GNUC__) && !(defined(__INTEL_COMPILER))
-  #pragma GCC diagnostic ignored "-Wuninitialized"
-  #pragma GCC diagnostic ignored "-Wconversion"
-  #pragma GCC diagnostic ignored "-Wunused-variable"
-  #pragma GCC diagnostic ignored "-Wparentheses"
-  #pragma GCC diagnostic ignored "-Wcast-qual"
-#endif
-
 #include "sip_qtipart0.cpp"
diff --git a/Code/Mantid/MantidPlot/src/zlib123/minigzip.c b/Code/Mantid/MantidPlot/src/zlib123/minigzip.c
index 5df454d1a8218d8b19bfeadef430f665b52b8fb1..6f12762c8ecedb7a71ddf33c3f7f848178ba3075 100644
--- a/Code/Mantid/MantidPlot/src/zlib123/minigzip.c
+++ b/Code/Mantid/MantidPlot/src/zlib123/minigzip.c
@@ -252,7 +252,7 @@ void file_uncompress(file)
     {
         outfile = file;
         infile = buf;
-        // Add the .gz suffix to the filename in buf/infile
+        /* Add the .gz suffix to the filename in buf/infile */
         strcat(buf, GZ_SUFFIX);
     }
     in = gzopen(infile, "rb");
diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/Message.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/Message.h
index 0f5c32d37b4c8cec55d5faa814b035faeb5da83a..c14f3a1fd7adab22e8c8ca8bcb1d494179fc9b99 100644
--- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/Message.h
+++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/Message.h
@@ -58,6 +58,6 @@ namespace MantidQt
 }
 
 /// Required to operate in signals/slots
-Q_DECLARE_METATYPE(MantidQt::API::Message);
+Q_DECLARE_METATYPE(MantidQt::API::Message)
 
 #endif //MESSAGE_H_
diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/PlotAxis.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/PlotAxis.h
index 6da97440087d0fe165412791ef41846ca96ea888..6cf577e0b7c7a0c003ee919574d374e03559b8ac 100644
--- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/PlotAxis.h
+++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/PlotAxis.h
@@ -50,7 +50,7 @@ namespace MantidQt
       QString title() const;
 
     private:
-      DISABLE_DEFAULT_CONSTRUCT(PlotAxis);
+      DISABLE_DEFAULT_CONSTRUCT(PlotAxis)
 
       /// Creates a title suitable for an axis attached to the given index
       void titleFromIndex(const Mantid::API::IMDWorkspace & workspace,
diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/QtSignalChannel.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/QtSignalChannel.h
index 50dfe80ca77d443cfb590bd030e324acc4c6f5bd..b598204b47d0944f731d8d7c1384c3014f2b0b97 100644
--- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/QtSignalChannel.h
+++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/QtSignalChannel.h
@@ -66,7 +66,7 @@ namespace MantidQt
       void messageReceived(const Message & msg);
 
     private:
-      Q_DISABLE_COPY(QtSignalChannel);
+      Q_DISABLE_COPY(QtSignalChannel)
 
       /// Optional source (use std::string to avoid conversion in comparison)
       QString m_source;
diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/RepoModel.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/RepoModel.h
index 8ecc05547ef1fa50b8c1bf1d9048f4a3313ceb9d..f630804187fa97a659a7f9f8212ed5b0346f6c28 100644
--- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/RepoModel.h
+++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/RepoModel.h
@@ -223,7 +223,7 @@ private:
     /// auxiliary method to help populating the model
     RepoItem * getParent(const QString & folder, QList<RepoItem*>&parents);
 
-    Q_DISABLE_COPY(RepoModel);
+    Q_DISABLE_COPY(RepoModel)
     
     /// auxiliary method to deal with exceptions
     void handleExceptions(const Mantid::API::ScriptRepoException & ex, 
@@ -257,7 +257,7 @@ private:
 
   };
 
-}; // namespace API
-};// namespace Mantid
+} // namespace API
+} // namespace Mantid
 
 #endif  /* MANTID_API_SCRIPTREPOSITORYVIEW_H_ */
diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/SignalRange.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/SignalRange.h
index 5e8cf13d92773e82fa1a196f5adcd90f8bf9c2d7..99a9ebba7ea66fca3ab2bd18a755ab9630b984ae 100644
--- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/SignalRange.h
+++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/SignalRange.h
@@ -47,7 +47,7 @@ namespace MantidQt
       QwtDoubleInterval interval() const;
 
     private:
-      DISABLE_DEFAULT_CONSTRUCT(SignalRange);
+      DISABLE_DEFAULT_CONSTRUCT(SignalRange)
 
       /// Find the min/max signal values in the entire workspace
       void findFullRange(const Mantid::API::IMDWorkspace & workspace,
diff --git a/Code/Mantid/MantidQt/API/src/MdConstants.cpp b/Code/Mantid/MantidQt/API/src/MdConstants.cpp
index d07c67b26b2edbad35472f1cbaea85883b490f5a..5eae091543035e64d667dcf69114833dae30c329 100644
--- a/Code/Mantid/MantidQt/API/src/MdConstants.cpp
+++ b/Code/Mantid/MantidQt/API/src/MdConstants.cpp
@@ -12,9 +12,9 @@ namespace MantidQt
     {
       initializeSettingsConstants();
       initializeViewConstants();
-    };
+    }
 
-    MdConstants::~MdConstants(){};
+    MdConstants::~MdConstants(){}
 
     void MdConstants::initializeSettingsConstants()
     {
diff --git a/Code/Mantid/MantidQt/API/src/PropertyWidget.cpp b/Code/Mantid/MantidQt/API/src/PropertyWidget.cpp
index 4b938ef3b9454bdb92eb9a48627ee80101aa7e22..2af591dd93965559c09b3a47daef8e4975725b75 100644
--- a/Code/Mantid/MantidQt/API/src/PropertyWidget.cpp
+++ b/Code/Mantid/MantidQt/API/src/PropertyWidget.cpp
@@ -171,7 +171,7 @@ namespace API
   /**
    * Destructor.
    */
-  ClickableLabel::~ClickableLabel() {};
+  ClickableLabel::~ClickableLabel() {}
 
   /**
    * Catches the mouse press event and emits the signal.
diff --git a/Code/Mantid/MantidQt/API/src/RepoModel.cpp b/Code/Mantid/MantidQt/API/src/RepoModel.cpp
index 14e3a8ebbc84bc57c1bcfd3944fe184ac9d30b84..0fd6e88b36bcf864f97927794d3ed9674a201295 100644
--- a/Code/Mantid/MantidQt/API/src/RepoModel.cpp
+++ b/Code/Mantid/MantidQt/API/src/RepoModel.cpp
@@ -940,21 +940,21 @@ bool RepoModel::isUploading(const QModelIndex & index)const{
 
 
 /// @return string to define the LOCAL_ONLY state
-const QString & RepoModel::localOnlySt(){return LOCALONLY;}; 
+const QString & RepoModel::localOnlySt(){return LOCALONLY;}
 /// @return string to define the REMOTE_ONLY state
-const QString & RepoModel::remoteOnlySt(){return REMOTEONLY;}; 
+const QString & RepoModel::remoteOnlySt(){return REMOTEONLY;}
 /// @return string to define the LOCAL_CHANGED state
-const QString & RepoModel::localChangedSt(){return LOCALCHANGED;}; 
+const QString & RepoModel::localChangedSt(){return LOCALCHANGED;}
 /// @return string to define the REMOTE_CHANGED state
-const QString & RepoModel::remoteChangedSt(){return REMOTECHANGED;}; 
+const QString & RepoModel::remoteChangedSt(){return REMOTECHANGED;}
 /// @return string to define the BOTH_UNCHANGED state
-const QString & RepoModel::updatedSt(){return BOTHUNCHANGED;}; 
+const QString & RepoModel::updatedSt(){return BOTHUNCHANGED;}
 /// @return string to define the BOTH_CHANGED state
-const QString & RepoModel::bothChangedSt(){return BOTHCHANGED;};
+const QString & RepoModel::bothChangedSt(){return BOTHCHANGED;}
 /// @return string to define the downloading state
-const QString & RepoModel::downloadSt(){return DOWNLOADST;};
+const QString & RepoModel::downloadSt(){return DOWNLOADST;}
 /// @return string to define the uploading state
-const QString & RepoModel::uploadSt(){return UPLOADST;};
+const QString & RepoModel::uploadSt(){return UPLOADST;}
 
 
 
diff --git a/Code/Mantid/MantidQt/API/src/ScriptRepositoryView.cpp b/Code/Mantid/MantidQt/API/src/ScriptRepositoryView.cpp
index 96cd7bcd4f4b3b742ae7006a272f36d329aa225c..5f76e642dc0ec7aab6683f0c939dbfc7f2ecebd0 100644
--- a/Code/Mantid/MantidQt/API/src/ScriptRepositoryView.cpp
+++ b/Code/Mantid/MantidQt/API/src/ScriptRepositoryView.cpp
@@ -377,7 +377,7 @@ bool  ScriptRepositoryView::RepoDelegate::editorEvent(QEvent *event,
 QSize ScriptRepositoryView::RepoDelegate::sizeHint(const QStyleOptionViewItem & /*option*/, const QModelIndex & /*index*/ ) const{
   return QSize(35,35);
 
-} ;
+}
 
 
 //////////////////////////////////////////////////
diff --git a/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/SampleShapeHelpers.h b/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/SampleShapeHelpers.h
index 4a774a9bfdf3883949c0b5c69976e898ecf78940..a83e99cb3bcba6f67e08876855e0a3ab96bddd38 100644
--- a/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/SampleShapeHelpers.h
+++ b/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/SampleShapeHelpers.h
@@ -34,7 +34,7 @@ class ShapeDetails;
  */
 class PointGroupBox : public QGroupBox
 {
-  Q_OBJECT;
+  Q_OBJECT
 
 public:
   //Default constructor
diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp
index 1cad4d1c3eed2aa02c91eb775887ec5117678447..e16e6621686daa9fbd125bc94dddf8ed62462ac6 100644
--- a/Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp
+++ b/Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp
@@ -14,7 +14,7 @@ namespace MantidQt
 {
   namespace CustomDialogs
   {
-    DECLARE_DIALOG(CatalogPublishDialog);
+    DECLARE_DIALOG(CatalogPublishDialog)
 
     /**
      * Default constructor.
diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/ConvertTableToMatrixWorkspaceDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/ConvertTableToMatrixWorkspaceDialog.cpp
index 96b80b7c1a10d8c9bd49bcb0de432e4d3fb7af0f..314e3b9d9e81a95567f8f941eb6110ab35e6c222 100644
--- a/Code/Mantid/MantidQt/CustomDialogs/src/ConvertTableToMatrixWorkspaceDialog.cpp
+++ b/Code/Mantid/MantidQt/CustomDialogs/src/ConvertTableToMatrixWorkspaceDialog.cpp
@@ -22,7 +22,7 @@ namespace MantidQt
   namespace CustomDialogs
   {
     // Declare the dialog. Name must match the class name
-    DECLARE_DIALOG(ConvertTableToMatrixWorkspaceDialog);
+    DECLARE_DIALOG(ConvertTableToMatrixWorkspaceDialog)
 
     //--------------------------------------------------------------------------
     // Public methods
diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/CreateSampleShapeDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/CreateSampleShapeDialog.cpp
index c0345f3727b179b415cb8d877a1bb3642a76a87a..02aa58ba0026daf06094976a5a807d40226ee04c 100644
--- a/Code/Mantid/MantidQt/CustomDialogs/src/CreateSampleShapeDialog.cpp
+++ b/Code/Mantid/MantidQt/CustomDialogs/src/CreateSampleShapeDialog.cpp
@@ -24,7 +24,7 @@ namespace MantidQt
 {
 namespace CustomDialogs
 {
-  DECLARE_DIALOG(CreateSampleShapeDialog);
+  DECLARE_DIALOG(CreateSampleShapeDialog)
 }
 }
 
diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/FitDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/FitDialog.cpp
index 7b4217a2dc42a1c363509643b2f6cfe3c7849d7c..d39863b1b7767173d76e1c7b7024b48fab709f25 100644
--- a/Code/Mantid/MantidQt/CustomDialogs/src/FitDialog.cpp
+++ b/Code/Mantid/MantidQt/CustomDialogs/src/FitDialog.cpp
@@ -31,7 +31,7 @@ namespace CustomDialogs
 {
 
 // Declare the dialog. Name must match the class name
-DECLARE_DIALOG(FitDialog);
+DECLARE_DIALOG(FitDialog)
 
 //------------------------------------------------------
 // InputWorkspaceWidget methods
diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/LOQScriptInputDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/LOQScriptInputDialog.cpp
index 5fdda1e5b182bbbbc9a093bd6bbf840dc01bdf38..15280c6c137d709330b7f28fcdd760c936618603 100644
--- a/Code/Mantid/MantidQt/CustomDialogs/src/LOQScriptInputDialog.cpp
+++ b/Code/Mantid/MantidQt/CustomDialogs/src/LOQScriptInputDialog.cpp
@@ -13,7 +13,7 @@ namespace MantidQt
 {
 namespace CustomDialogs
 {
-  DECLARE_DIALOG(LOQScriptInputDialog);
+  DECLARE_DIALOG(LOQScriptInputDialog)
 }
 }
 
diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp
index 2f88ee8c8972a01ab23344eebd9e4b6545bded73..7c4f993de8deda0bdbbf36c86f8a933d1323bd2a 100644
--- a/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp
+++ b/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp
@@ -41,7 +41,7 @@ namespace MantidQt
     }
 
     // Declare the dialog. Name must match the class name
-    DECLARE_DIALOG(LoadDialog);
+    DECLARE_DIALOG(LoadDialog)
 
     //--------------------------------------------------------------------------
     // Public methods
diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/LoadInstrumentDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/LoadInstrumentDialog.cpp
index 37192b4c29992eacad85712ece2b9f4edfbca603..5716406111d92270b3c458c55d12be125a332c2b 100644
--- a/Code/Mantid/MantidQt/CustomDialogs/src/LoadInstrumentDialog.cpp
+++ b/Code/Mantid/MantidQt/CustomDialogs/src/LoadInstrumentDialog.cpp
@@ -11,7 +11,7 @@ namespace MantidQt
 {
   namespace CustomDialogs
   {
-    DECLARE_DIALOG(LoadInstrumentDialog);
+    DECLARE_DIALOG(LoadInstrumentDialog)
 
     /**
     Constructor
diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/SortTableWorkspaceDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/SortTableWorkspaceDialog.cpp
index 5b2a0dc90887d7f12a5feccb3c54ecdaadb478c9..7a81d7a310dc9bce13ba71f3205d938db5bf6736 100644
--- a/Code/Mantid/MantidQt/CustomDialogs/src/SortTableWorkspaceDialog.cpp
+++ b/Code/Mantid/MantidQt/CustomDialogs/src/SortTableWorkspaceDialog.cpp
@@ -15,7 +15,7 @@ namespace CustomDialogs
 {
 
 // Declare the dialog. Name must match the class name
-DECLARE_DIALOG(SortTableWorkspaceDialog);
+DECLARE_DIALOG(SortTableWorkspaceDialog)
 
 
 /// Default constructor
diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/StartLiveDataDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/StartLiveDataDialog.cpp
index 65330a4d7d5f02c2605754fc78f702ab9470dc9e..0450d6bd8eaf6fa7e9de4db4d790a0a66bc3f5d9 100644
--- a/Code/Mantid/MantidQt/CustomDialogs/src/StartLiveDataDialog.cpp
+++ b/Code/Mantid/MantidQt/CustomDialogs/src/StartLiveDataDialog.cpp
@@ -64,7 +64,7 @@ namespace MantidQt
 {
 namespace CustomDialogs
 {
-  DECLARE_DIALOG(StartLiveDataDialog);
+  DECLARE_DIALOG(StartLiveDataDialog)
 
 //----------------------
 // Public member functions
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IReflPresenter.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IReflPresenter.h
index 52720837cbe2bacaba64f456483a9add0410a43c..9acf1b47564a38313f2d7b1cdeecaf941a68f1a2 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IReflPresenter.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IReflPresenter.h
@@ -64,7 +64,7 @@ namespace MantidQt
         ImportTableFlag,
         ExportTableFlag,
         PlotRowFlag,
-        PlotGroupFlag,
+        PlotGroupFlag
       };
 
       //Tell the presenter something happened
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.h
index 2bb6f7f0130a9b2020af35f140cb87c8e0afda6b..d521c6f5df8cd3f1a374792c42cad55cefb69eef 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.h
@@ -310,6 +310,12 @@ private slots:
   /// Slot to load a peaks workspace to the current MantidEV named workspace
   void loadIsawPeaks_slot();
 
+  /// Slot to save the current MantidEV peaks workspace
+  void saveNexusPeaks_slot();
+
+  /// Slot to load a peaks workspace to the current MantidEV named workspace
+  void loadNexusPeaks_slot();
+
   /// Slot to show the UB matrix
   void showUB_slot();
   
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.ui
index bffc3627533b62b8a837bb18c45adffc169d2487..4906f166dbcb095a57fff07ca31a045459a3fce7 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.ui
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.ui
@@ -20,3442 +20,3435 @@
    <string>SCD Event Data Reduction</string>
   </property>
   <widget class="QWidget" name="centralwidget">
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <item>
-    <widget class="QMenuBar" name="menubar">
-     <widget class="QMenu" name="menuFile">
-      <property name="title">
-       <string>File</string>
-      </property>
-      <addaction name="actionSave_Isaw_UB"/>
-      <addaction name="actionLoad_Isaw_UB"/>
-      <addaction name="actionSave_Isaw_Peaks"/>
-      <addaction name="actionLoad_Isaw_Peaks"/>
-      <addaction name="actionSave_State"/>
-      <addaction name="actionLoad_State"/>
-      <addaction name="actionReset_Default_Settings"/>
-     </widget>
-     <widget class="QMenu" name="menuView">
-      <property name="title">
-       <string>View</string>
-      </property>
-      <addaction name="actionShow_UB"/>
+   <layout class="QVBoxLayout" name="verticalLayout">
+    <item>
+     <widget class="QMenuBar" name="menubar">
+      <widget class="QMenu" name="menuFile">
+       <property name="title">
+        <string>File</string>
+       </property>
+       <addaction name="actionSave_Isaw_UB"/>
+       <addaction name="actionLoad_Isaw_UB"/>
+       <addaction name="actionSave_Isaw_Peaks"/>
+       <addaction name="actionLoad_Isaw_Peaks"/>
+       <addaction name="actionSave_Nexus_Peaks"/>
+       <addaction name="actionLoad_Nexus_Peaks"/>
+       <addaction name="actionSave_State"/>
+       <addaction name="actionLoad_State"/>
+       <addaction name="actionReset_Default_Settings"/>
+      </widget>
+      <widget class="QMenu" name="menuView">
+       <property name="title">
+        <string>View</string>
+       </property>
+       <addaction name="actionShow_UB"/>
+      </widget>
+      <widget class="QMenu" name="menuHelp">
+       <property name="title">
+        <string>Help</string>
+       </property>
+       <addaction name="actionOnline_Help_Page"/>
+      </widget>
+      <addaction name="menuFile"/>
+      <addaction name="menuView"/>
+      <addaction name="menuHelp"/>
      </widget>
-     <widget class="QMenu" name="menuHelp">
-      <property name="title">
-       <string>Help</string>
+    </item>
+    <item>
+     <widget class="QTabWidget" name="MantidEV_tabwidg">
+      <property name="toolTip">
+       <string/>
       </property>
-      <addaction name="actionOnline_Help_Page"/>
-     </widget>
-     <addaction name="menuFile"/>
-     <addaction name="menuView"/>
-     <addaction name="menuHelp"/>
-    </widget>
-   </item>
-   <item>
-    <widget class="QTabWidget" name="MantidEV_tabwidg">
-     <property name="toolTip">
-      <string/>
-     </property>
-     <property name="currentIndex">
-      <number>3</number>
-     </property>
-     <widget class="QWidget" name="SelectData">
-      <property name="sizePolicy">
-       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-        <horstretch>0</horstretch>
-        <verstretch>0</verstretch>
-       </sizepolicy>
+      <property name="currentIndex">
+       <number>1</number>
       </property>
-      <attribute name="title">
-       <string>Select Data</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_3">
-       <item>
-        <widget class="QScrollArea" name="selectDataScrollArea">
-         <property name="enabled">
-          <bool>true</bool>
-         </property>
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="minimumSize">
-          <size>
-           <width>0</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="baseSize">
-          <size>
-           <width>0</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="frameShape">
-          <enum>QFrame::NoFrame</enum>
-         </property>
-         <property name="frameShadow">
-          <enum>QFrame::Plain</enum>
-         </property>
-         <property name="lineWidth">
-          <number>0</number>
-         </property>
-         <property name="verticalScrollBarPolicy">
-          <enum>Qt::ScrollBarAsNeeded</enum>
-         </property>
-         <property name="widgetResizable">
-          <bool>true</bool>
-         </property>
-         <property name="alignment">
-          <set>Qt::AlignCenter</set>
-         </property>
-         <widget class="QWidget" name="scrollAreaWidgetContents">
-          <property name="geometry">
-           <rect>
-            <x>0</x>
-            <y>0</y>
-            <width>903</width>
-            <height>708</height>
-           </rect>
+      <widget class="QWidget" name="SelectData">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <attribute name="title">
+        <string>Select Data</string>
+       </attribute>
+       <layout class="QVBoxLayout" name="verticalLayout_3">
+        <item>
+         <widget class="QScrollArea" name="selectDataScrollArea">
+          <property name="enabled">
+           <bool>true</bool>
+          </property>
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
           </property>
           <property name="minimumSize">
            <size>
-            <width>500</width>
-            <height>500</height>
+            <width>0</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="baseSize">
+           <size>
+            <width>0</width>
+            <height>0</height>
            </size>
           </property>
-          <property name="autoFillBackground">
+          <property name="frameShape">
+           <enum>QFrame::NoFrame</enum>
+          </property>
+          <property name="frameShadow">
+           <enum>QFrame::Plain</enum>
+          </property>
+          <property name="lineWidth">
+           <number>0</number>
+          </property>
+          <property name="verticalScrollBarPolicy">
+           <enum>Qt::ScrollBarAsNeeded</enum>
+          </property>
+          <property name="widgetResizable">
            <bool>true</bool>
           </property>
-          <layout class="QVBoxLayout" name="verticalLayout_7">
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_7">
-             <property name="sizeConstraint">
-              <enum>QLayout::SetDefaultConstraint</enum>
-             </property>
-             <item>
-              <widget class="QLabel" name="SelectEventWorkspace_lbl">
-               <property name="text">
-                <string>Event Workspace Name</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_6">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="SelectEventWorkspace_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="minimumSize">
-                <size>
-                 <width>200</width>
-                 <height>0</height>
-                </size>
-               </property>
-               <property name="toolTip">
-                <string>Name of the event workspace to use.  This name is set by default,&lt;br&gt; if data is loaded from an event file and mapped to an MD workspace.</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_8">
-             <item>
-              <widget class="QLabel" name="SelectMDWorkspace_lbl">
-               <property name="text">
-                <string>MD Workspace Name</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_7">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="MDworkspace_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="minimumSize">
-                <size>
-                 <width>200</width>
-                 <height>0</height>
-                </size>
-               </property>
-               <property name="toolTip">
-                <string>Name of the MD workspace to use.  This name is set&lt;br&gt;by default, if data is loaded from an event file and mapped to an MD workspace.</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QGroupBox" name="convertToMDGroupBox">
-             <property name="minimumSize">
-              <size>
-               <width>0</width>
-               <height>160</height>
-              </size>
-             </property>
-             <property name="toolTip">
-              <string>Not doing this will use existing workspace</string>
-             </property>
-             <property name="title">
-              <string>Convert to MD</string>
-             </property>
-             <property name="checkable">
-              <bool>true</bool>
-             </property>
-             <layout class="QVBoxLayout" name="verticalLayout_8">
-              <item>
-               <layout class="QVBoxLayout" name="verticalLayout_4">
-                <property name="sizeConstraint">
-                 <enum>QLayout::SetDefaultConstraint</enum>
-                </property>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_3">
-                  <item>
-                   <widget class="QLabel" name="MinMagQ_lbl">
-                    <property name="text">
-                     <string>Min |Q| to Map to MD</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_2">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="MinMagQ_ledt">
-                    <property name="sizePolicy">
-                     <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                      <horstretch>0</horstretch>
-                      <verstretch>0</verstretch>
-                     </sizepolicy>
-                    </property>
-                    <property name="minimumSize">
-                     <size>
-                      <width>50</width>
-                      <height>0</height>
-                     </size>
-                    </property>
-                    <property name="toolTip">
-                     <string>Specify value to use as bound on |Qx|, |Qy| and |Qz|</string>
-                    </property>
-                   </widget>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_2">
-                  <item>
-                   <widget class="QLabel" name="MaxMagQ_lbl">
-                    <property name="text">
-                     <string>Max |Q| to Map to MD</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="MaxMagQ_ledt">
-                    <property name="sizePolicy">
-                     <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                      <horstretch>0</horstretch>
-                      <verstretch>0</verstretch>
-                     </sizepolicy>
-                    </property>
-                    <property name="minimumSize">
-                     <size>
-                      <width>50</width>
-                      <height>0</height>
-                     </size>
-                    </property>
-                    <property name="toolTip">
-                     <string>Specify value to use as bound on |Qx|, |Qy| and |Qz|</string>
-                    </property>
-                   </widget>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <widget class="QCheckBox" name="LorentzCorrection_ckbx">
-                  <property name="toolTip">
-                   <string>Apply the Lorentz Correction as&lt;br&gt; data is mapped to reciprocal space and stored in the MD workspace.  This helps with finding peaks with larger |Q|.</string>
-                  </property>
-                  <property name="text">
-                   <string>Apply Lorentz Correction</string>
-                  </property>
-                 </widget>
-                </item>
-               </layout>
+          <property name="alignment">
+           <set>Qt::AlignCenter</set>
+          </property>
+          <widget class="QWidget" name="scrollAreaWidgetContents">
+           <property name="geometry">
+            <rect>
+             <x>0</x>
+             <y>0</y>
+             <width>903</width>
+             <height>696</height>
+            </rect>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>500</width>
+             <height>500</height>
+            </size>
+           </property>
+           <property name="autoFillBackground">
+            <bool>true</bool>
+           </property>
+           <layout class="QVBoxLayout" name="verticalLayout_7">
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_7">
+              <property name="sizeConstraint">
+               <enum>QLayout::SetDefaultConstraint</enum>
+              </property>
+              <item>
+               <widget class="QLabel" name="SelectEventWorkspace_lbl">
+                <property name="text">
+                 <string>Event Workspace Name</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_6">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="SelectEventWorkspace_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="minimumSize">
+                 <size>
+                  <width>200</width>
+                  <height>0</height>
+                 </size>
+                </property>
+                <property name="toolTip">
+                 <string>Name of the event workspace to use.  This name is set by default,&lt;br&gt; if data is loaded from an event file and mapped to an MD workspace.</string>
+                </property>
+               </widget>
               </item>
              </layout>
-            </widget>
-           </item>
-           <item>
-            <widget class="QGroupBox" name="loadDataGroupBox">
-             <property name="minimumSize">
-              <size>
-               <width>0</width>
-               <height>200</height>
-              </size>
-             </property>
-             <property name="toolTip">
-              <string>If disabled then use existing workspaces</string>
-             </property>
-             <property name="title">
-              <string>Load Event Data</string>
-             </property>
-             <property name="checkable">
-              <bool>true</bool>
-             </property>
-             <layout class="QVBoxLayout" name="verticalLayout_5">
-              <item>
-               <layout class="QVBoxLayout" name="verticalLayout_6">
-                <property name="sizeConstraint">
-                 <enum>QLayout::SetDefaultConstraint</enum>
-                </property>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_6">
-                  <item>
-                   <widget class="QLabel" name="EventFileName_lbl">
-                    <property name="text">
-                     <string>Filename</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_5">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="EventFileName_ledt">
-                    <property name="sizePolicy">
-                     <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                      <horstretch>0</horstretch>
-                      <verstretch>0</verstretch>
-                     </sizepolicy>
-                    </property>
-                    <property name="minimumSize">
-                     <size>
-                      <width>400</width>
-                      <height>0</height>
-                     </size>
-                    </property>
-                    <property name="toolTip">
-                     <string>Specify the name of the data file to load.  Press&lt;br&gt; return to set default names for Event, MD and Peaks workspaces.</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QPushButton" name="SelectEventFile_btn">
-                    <property name="toolTip">
-                     <string>Browse for the event file to be loaded.</string>
-                    </property>
-                    <property name="text">
-                     <string>Browse</string>
-                    </property>
-                   </widget>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <widget class="QCheckBox" name="LoadDetCal_ckbx">
-                  <property name="toolTip">
-                   <string>Optionally, apply&lt;br&gt; calibration  information from the specified .DetCal file(s).</string>
-                  </property>
-                  <property name="text">
-                   <string> Load ISAW Detector Calibration</string>
-                  </property>
-                 </widget>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_5">
-                  <item>
-                   <widget class="QLabel" name="CalFileName_lbl">
-                    <property name="text">
-                     <string>Filename</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_4">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Expanding</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="CalFileName_ledt">
-                    <property name="sizePolicy">
-                     <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                      <horstretch>0</horstretch>
-                      <verstretch>0</verstretch>
-                     </sizepolicy>
-                    </property>
-                    <property name="minimumSize">
-                     <size>
-                      <width>400</width>
-                      <height>0</height>
-                     </size>
-                    </property>
-                    <property name="toolTip">
-                     <string>Select the .DetCal file to apply.</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QPushButton" name="SelectCalFile_btn">
-                    <property name="toolTip">
-                     <string>Browse for the first .DetCal file to be used.</string>
-                    </property>
-                    <property name="text">
-                     <string>Browse</string>
-                    </property>
-                   </widget>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_4">
-                  <item>
-                   <widget class="QLabel" name="CalFileName2_lbl">
-                    <property name="text">
-                     <string>Filename2</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_3">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Expanding</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="CalFileName2_ledt">
-                    <property name="sizePolicy">
-                     <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                      <horstretch>0</horstretch>
-                      <verstretch>0</verstretch>
-                     </sizepolicy>
-                    </property>
-                    <property name="minimumSize">
-                     <size>
-                      <width>400</width>
-                      <height>0</height>
-                     </size>
-                    </property>
-                    <property name="toolTip">
-                     <string>Select the second .DetCal file for the second detector&lt;br&gt; panel on the SNAP instrument at the SNS.</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QPushButton" name="SelectCalFile2_btn">
-                    <property name="toolTip">
-                     <string>Browse for the second .DetCal file to be used&lt;br&gt; for the second panel on SNAP.</string>
-                    </property>
-                    <property name="text">
-                     <string>Browse</string>
-                    </property>
-                   </widget>
-                  </item>
-                 </layout>
-                </item>
-               </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_8">
+              <item>
+               <widget class="QLabel" name="SelectMDWorkspace_lbl">
+                <property name="text">
+                 <string>MD Workspace Name</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_7">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="MDworkspace_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="minimumSize">
+                 <size>
+                  <width>200</width>
+                  <height>0</height>
+                 </size>
+                </property>
+                <property name="toolTip">
+                 <string>Name of the MD workspace to use.  This name is set&lt;br&gt;by default, if data is loaded from an event file and mapped to an MD workspace.</string>
+                </property>
+               </widget>
               </item>
              </layout>
-            </widget>
-           </item>
-           <item>
-            <spacer name="verticalSpacer">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_9">
-             <property name="sizeConstraint">
-              <enum>QLayout::SetDefaultConstraint</enum>
-             </property>
-             <item>
-              <spacer name="horizontalSpacer_10">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QPushButton" name="ApplySelectData_btn">
-               <property name="toolTip">
-                <string>Actually load the data and convert to MD, or just&lt;br&gt; proceed to the next tab using previously loaded data.</string>
-               </property>
-               <property name="text">
-                <string>Apply</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-          </layout>
+            </item>
+            <item>
+             <widget class="QGroupBox" name="convertToMDGroupBox">
+              <property name="minimumSize">
+               <size>
+                <width>0</width>
+                <height>160</height>
+               </size>
+              </property>
+              <property name="toolTip">
+               <string>Not doing this will use existing workspace</string>
+              </property>
+              <property name="title">
+               <string>Convert to MD</string>
+              </property>
+              <property name="checkable">
+               <bool>true</bool>
+              </property>
+              <layout class="QVBoxLayout" name="verticalLayout_8">
+               <item>
+                <layout class="QVBoxLayout" name="verticalLayout_4">
+                 <property name="sizeConstraint">
+                  <enum>QLayout::SetDefaultConstraint</enum>
+                 </property>
+                 <item>
+                  <layout class="QHBoxLayout" name="horizontalLayout_3">
+                   <item>
+                    <widget class="QLabel" name="MinMagQ_lbl">
+                     <property name="text">
+                      <string>Min |Q| to Map to MD</string>
+                     </property>
+                    </widget>
+                   </item>
+                   <item>
+                    <spacer name="horizontalSpacer_2">
+                     <property name="orientation">
+                      <enum>Qt::Horizontal</enum>
+                     </property>
+                     <property name="sizeHint" stdset="0">
+                      <size>
+                       <width>40</width>
+                       <height>20</height>
+                      </size>
+                     </property>
+                    </spacer>
+                   </item>
+                   <item>
+                    <widget class="QLineEdit" name="MinMagQ_ledt">
+                     <property name="sizePolicy">
+                      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                       <horstretch>0</horstretch>
+                       <verstretch>0</verstretch>
+                      </sizepolicy>
+                     </property>
+                     <property name="minimumSize">
+                      <size>
+                       <width>50</width>
+                       <height>0</height>
+                      </size>
+                     </property>
+                     <property name="toolTip">
+                      <string>Specify value to use as bound on |Qx|, |Qy| and |Qz|</string>
+                     </property>
+                    </widget>
+                   </item>
+                  </layout>
+                 </item>
+                 <item>
+                  <layout class="QHBoxLayout" name="horizontalLayout_2">
+                   <item>
+                    <widget class="QLabel" name="MaxMagQ_lbl">
+                     <property name="text">
+                      <string>Max |Q| to Map to MD</string>
+                     </property>
+                    </widget>
+                   </item>
+                   <item>
+                    <spacer name="horizontalSpacer">
+                     <property name="orientation">
+                      <enum>Qt::Horizontal</enum>
+                     </property>
+                     <property name="sizeHint" stdset="0">
+                      <size>
+                       <width>40</width>
+                       <height>20</height>
+                      </size>
+                     </property>
+                    </spacer>
+                   </item>
+                   <item>
+                    <widget class="QLineEdit" name="MaxMagQ_ledt">
+                     <property name="sizePolicy">
+                      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                       <horstretch>0</horstretch>
+                       <verstretch>0</verstretch>
+                      </sizepolicy>
+                     </property>
+                     <property name="minimumSize">
+                      <size>
+                       <width>50</width>
+                       <height>0</height>
+                      </size>
+                     </property>
+                     <property name="toolTip">
+                      <string>Specify value to use as bound on |Qx|, |Qy| and |Qz|</string>
+                     </property>
+                    </widget>
+                   </item>
+                  </layout>
+                 </item>
+                 <item>
+                  <widget class="QCheckBox" name="LorentzCorrection_ckbx">
+                   <property name="toolTip">
+                    <string>Apply the Lorentz Correction as&lt;br&gt; data is mapped to reciprocal space and stored in the MD workspace.  This helps with finding peaks with larger |Q|.</string>
+                   </property>
+                   <property name="text">
+                    <string>Apply Lorentz Correction</string>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+              </layout>
+             </widget>
+            </item>
+            <item>
+             <widget class="QGroupBox" name="loadDataGroupBox">
+              <property name="minimumSize">
+               <size>
+                <width>0</width>
+                <height>200</height>
+               </size>
+              </property>
+              <property name="toolTip">
+               <string>If disabled then use existing workspaces</string>
+              </property>
+              <property name="title">
+               <string>Load Event Data</string>
+              </property>
+              <property name="checkable">
+               <bool>true</bool>
+              </property>
+              <layout class="QVBoxLayout" name="verticalLayout_5">
+               <item>
+                <layout class="QVBoxLayout" name="verticalLayout_6">
+                 <property name="sizeConstraint">
+                  <enum>QLayout::SetDefaultConstraint</enum>
+                 </property>
+                 <item>
+                  <layout class="QHBoxLayout" name="horizontalLayout_6">
+                   <item>
+                    <widget class="QLabel" name="EventFileName_lbl">
+                     <property name="text">
+                      <string>Filename</string>
+                     </property>
+                    </widget>
+                   </item>
+                   <item>
+                    <spacer name="horizontalSpacer_5">
+                     <property name="orientation">
+                      <enum>Qt::Horizontal</enum>
+                     </property>
+                     <property name="sizeHint" stdset="0">
+                      <size>
+                       <width>40</width>
+                       <height>20</height>
+                      </size>
+                     </property>
+                    </spacer>
+                   </item>
+                   <item>
+                    <widget class="QLineEdit" name="EventFileName_ledt">
+                     <property name="sizePolicy">
+                      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                       <horstretch>0</horstretch>
+                       <verstretch>0</verstretch>
+                      </sizepolicy>
+                     </property>
+                     <property name="minimumSize">
+                      <size>
+                       <width>400</width>
+                       <height>0</height>
+                      </size>
+                     </property>
+                     <property name="toolTip">
+                      <string>Specify the name of the data file to load.  Press&lt;br&gt; return to set default names for Event, MD and Peaks workspaces.</string>
+                     </property>
+                    </widget>
+                   </item>
+                   <item>
+                    <widget class="QPushButton" name="SelectEventFile_btn">
+                     <property name="toolTip">
+                      <string>Browse for the event file to be loaded.</string>
+                     </property>
+                     <property name="text">
+                      <string>Browse</string>
+                     </property>
+                    </widget>
+                   </item>
+                  </layout>
+                 </item>
+                 <item>
+                  <widget class="QCheckBox" name="LoadDetCal_ckbx">
+                   <property name="toolTip">
+                    <string>Optionally, apply&lt;br&gt; calibration  information from the specified .DetCal file(s).</string>
+                   </property>
+                   <property name="text">
+                    <string> Load ISAW Detector Calibration</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <layout class="QHBoxLayout" name="horizontalLayout_5">
+                   <item>
+                    <widget class="QLabel" name="CalFileName_lbl">
+                     <property name="text">
+                      <string>Filename</string>
+                     </property>
+                    </widget>
+                   </item>
+                   <item>
+                    <spacer name="horizontalSpacer_4">
+                     <property name="orientation">
+                      <enum>Qt::Horizontal</enum>
+                     </property>
+                     <property name="sizeType">
+                      <enum>QSizePolicy::Expanding</enum>
+                     </property>
+                     <property name="sizeHint" stdset="0">
+                      <size>
+                       <width>40</width>
+                       <height>20</height>
+                      </size>
+                     </property>
+                    </spacer>
+                   </item>
+                   <item>
+                    <widget class="QLineEdit" name="CalFileName_ledt">
+                     <property name="sizePolicy">
+                      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                       <horstretch>0</horstretch>
+                       <verstretch>0</verstretch>
+                      </sizepolicy>
+                     </property>
+                     <property name="minimumSize">
+                      <size>
+                       <width>400</width>
+                       <height>0</height>
+                      </size>
+                     </property>
+                     <property name="toolTip">
+                      <string>Select the .DetCal file to apply.</string>
+                     </property>
+                    </widget>
+                   </item>
+                   <item>
+                    <widget class="QPushButton" name="SelectCalFile_btn">
+                     <property name="toolTip">
+                      <string>Browse for the first .DetCal file to be used.</string>
+                     </property>
+                     <property name="text">
+                      <string>Browse</string>
+                     </property>
+                    </widget>
+                   </item>
+                  </layout>
+                 </item>
+                 <item>
+                  <layout class="QHBoxLayout" name="horizontalLayout_4">
+                   <item>
+                    <widget class="QLabel" name="CalFileName2_lbl">
+                     <property name="text">
+                      <string>Filename2</string>
+                     </property>
+                    </widget>
+                   </item>
+                   <item>
+                    <spacer name="horizontalSpacer_3">
+                     <property name="orientation">
+                      <enum>Qt::Horizontal</enum>
+                     </property>
+                     <property name="sizeType">
+                      <enum>QSizePolicy::Expanding</enum>
+                     </property>
+                     <property name="sizeHint" stdset="0">
+                      <size>
+                       <width>40</width>
+                       <height>20</height>
+                      </size>
+                     </property>
+                    </spacer>
+                   </item>
+                   <item>
+                    <widget class="QLineEdit" name="CalFileName2_ledt">
+                     <property name="sizePolicy">
+                      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                       <horstretch>0</horstretch>
+                       <verstretch>0</verstretch>
+                      </sizepolicy>
+                     </property>
+                     <property name="minimumSize">
+                      <size>
+                       <width>400</width>
+                       <height>0</height>
+                      </size>
+                     </property>
+                     <property name="toolTip">
+                      <string>Select the second .DetCal file for the second detector&lt;br&gt; panel on the SNAP instrument at the SNS.</string>
+                     </property>
+                    </widget>
+                   </item>
+                   <item>
+                    <widget class="QPushButton" name="SelectCalFile2_btn">
+                     <property name="toolTip">
+                      <string>Browse for the second .DetCal file to be used&lt;br&gt; for the second panel on SNAP.</string>
+                     </property>
+                     <property name="text">
+                      <string>Browse</string>
+                     </property>
+                    </widget>
+                   </item>
+                  </layout>
+                 </item>
+                </layout>
+               </item>
+              </layout>
+             </widget>
+            </item>
+            <item>
+             <spacer name="verticalSpacer">
+              <property name="orientation">
+               <enum>Qt::Vertical</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>20</width>
+                <height>40</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_9">
+              <property name="sizeConstraint">
+               <enum>QLayout::SetDefaultConstraint</enum>
+              </property>
+              <item>
+               <spacer name="horizontalSpacer_10">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QPushButton" name="ApplySelectData_btn">
+                <property name="toolTip">
+                 <string>Actually load the data and convert to MD, or just&lt;br&gt; proceed to the next tab using previously loaded data.</string>
+                </property>
+                <property name="text">
+                 <string>Apply</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+           </layout>
+          </widget>
          </widget>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="FindPeaks">
-      <attribute name="title">
-       <string>Find Peaks</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_9">
-       <item>
-        <widget class="QScrollArea" name="scrollArea">
-         <property name="frameShape">
-          <enum>QFrame::NoFrame</enum>
-         </property>
-         <property name="frameShadow">
-          <enum>QFrame::Plain</enum>
-         </property>
-         <property name="widgetResizable">
-          <bool>true</bool>
-         </property>
-         <widget class="QWidget" name="scrollAreaWidgetContents_2">
-          <property name="geometry">
-           <rect>
-            <x>0</x>
-            <y>0</y>
-            <width>903</width>
-            <height>708</height>
-           </rect>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="FindPeaks">
+       <attribute name="title">
+        <string>Find Peaks</string>
+       </attribute>
+       <layout class="QVBoxLayout" name="verticalLayout_9">
+        <item>
+         <widget class="QScrollArea" name="scrollArea">
+          <property name="frameShape">
+           <enum>QFrame::NoFrame</enum>
           </property>
-          <layout class="QVBoxLayout" name="verticalLayout_10">
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_10">
-             <item>
-              <widget class="QLabel" name="PeaksWorkspace_lbl">
-               <property name="text">
-                <string>Peaks Workspace Name</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_18">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="PeaksWorkspace_ledt">
-               <property name="toolTip">
-                <string>Name of the peaks workspace to use.  This name is set by default,&lt;br&gt; if data is loaded from an event file and mapped to an MD workspace on the Select Data tab.</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="Line" name="line_2">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QRadioButton" name="FindPeaks_rbtn">
-             <property name="toolTip">
-              <string>Search through the MD workspace to find Bragg peaks.</string>
-             </property>
-             <property name="text">
-              <string>Find Peaks</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_11">
-             <item>
-              <spacer name="horizontalSpacer_9">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="MaxABC_lbl">
-               <property name="text">
-                <string>Estimated Max of a,b,c</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_14">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="MaxABC_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Estimated maximum for real&lt;br&gt; space cell edge length in Angstroms.  This is used to get an approximate lower bound on the possible distances between peaks.</string>
-               </property>
-               <property name="text">
-                <string>15</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_12">
-             <item>
-              <spacer name="horizontalSpacer_11">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="NumToFind_lbl">
-               <property name="text">
-                <string>Number of Peaks to Find</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_15">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="NumToFind_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Maximum number of peaks to find.  Boxes with progressively&lt;br&gt; lower local intensity will be tried, until the specified number of peaks is found, or until the intensity falls below the specified Min Intensity.</string>
-               </property>
-               <property name="text">
-                <string>50</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_13">
-             <item>
-              <spacer name="horizontalSpacer_12">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="MinIntensity_lbl">
-               <property name="text">
-                <string>Min Intensity(above ave)</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_16">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="MinIntensity_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Lower bound on the local intensity of MD boxes to consider as possible peaks, expressed as a multiple of the overall average intensity of the entire MD workspace region.  Boxes with progressively&lt;br&gt; lower local intensity will be tried, until the specified number of peaks is found, or until the intensity falls below the specified Min Intensity.</string>
-               </property>
-               <property name="text">
-                <string>10000</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QRadioButton" name="UseExistingPeaksWorkspace_rbtn">
-             <property name="toolTip">
-              <string>Use a peaks workspace with peaks that have been&lt;br&gt; been previously found, predicted, or loaded. </string>
-             </property>
-             <property name="text">
-              <string>Use Existing Peaks Workspace</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QRadioButton" name="LoadIsawPeaks_rbtn">
-             <property name="toolTip">
-              <string>Load the peaks workspace from a file of peaks&lt;br&gt; that have been previously found or predicted.</string>
-             </property>
-             <property name="text">
-              <string>Load ISAW Peaks (or Integrate) File</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_14">
-             <item>
-              <spacer name="horizontalSpacer_13">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="SelectPeaksFile_lbl">
-               <property name="text">
-                <string>Filename</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_17">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="SelectPeaksFile_ledt">
-               <property name="toolTip">
-                <string>Name of the peaks file that should be loaded.</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QPushButton" name="SelectPeaksFile_btn">
-               <property name="toolTip">
-                <string>Browse for the file of peaks to load.</string>
-               </property>
-               <property name="text">
-                <string>Browse</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <spacer name="verticalSpacer_2">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>20</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_15">
-             <item>
-              <spacer name="horizontalSpacer_8">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QPushButton" name="ApplyFindPeaks_btn">
-               <property name="toolTip">
-                <string>Proceed to actually get the&lt;br&gt; peaks or use the existing peaks, as specified..</string>
-               </property>
-               <property name="text">
-                <string>Apply</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </widget>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="FindUB">
-      <attribute name="title">
-       <string>Find UB</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_11">
-       <item>
-        <widget class="QScrollArea" name="scrollArea_2">
-         <property name="frameShape">
-          <enum>QFrame::NoFrame</enum>
-         </property>
-         <property name="frameShadow">
-          <enum>QFrame::Plain</enum>
-         </property>
-         <property name="widgetResizable">
-          <bool>true</bool>
-         </property>
-         <widget class="QWidget" name="scrollAreaWidgetContents_4">
-          <property name="geometry">
-           <rect>
-            <x>0</x>
-            <y>0</y>
-            <width>903</width>
-            <height>708</height>
-           </rect>
+          <property name="frameShadow">
+           <enum>QFrame::Plain</enum>
           </property>
-          <layout class="QVBoxLayout" name="verticalLayout_12">
-           <item>
-            <widget class="QRadioButton" name="FindUBUsingFFT_rbtn">
-             <property name="toolTip">
-              <string>Find a UB matrix using the&lt;br&gt; FindUBUsingFFT algorithm.  This will produce a UB matrix corresponding to the Niggli reduced cell for the lattice.</string>
-             </property>
-             <property name="text">
-              <string>Find UB Using FFT</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_20">
-             <item>
-              <spacer name="horizontalSpacer_28">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="MinD_lbl">
-               <property name="text">
-                <string>Estimated Lower Bound for a,b,c</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_29">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="MinD_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Set this to a value that is&lt;br&gt; about 50%-90% of the shortest real space edge length, in Angstroms.</string>
-               </property>
-               <property name="text">
-                <string>3</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_21">
-             <item>
-              <spacer name="horizontalSpacer_27">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="MaxD_lbl">
-               <property name="text">
-                <string>Estimated Upper Bound for a,b,c</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_30">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="MaxD_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Set this to a value that is&lt;br&gt; about 110%-150% of the longest real space edge length, in Angstroms.</string>
-               </property>
-               <property name="text">
-                <string>15</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_22">
-             <item>
-              <spacer name="horizontalSpacer_26">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="FFTTolerance_lbl">
-               <property name="text">
-                <string>Tolerance</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_31">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="FFTTolerance_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Maximum distance of h,k or l from integer values to&lt;br&gt; consider a peak to be indexed.</string>
-               </property>
-               <property name="text">
-                <string>0.12</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QRadioButton" name="FindUBUsingIndexedPeaks_rbtn">
-             <property name="toolTip">
-              <string>Find the UB matrix using the FindUBUsingIndexedPeaks algorithm.  Specifically, if the&lt;br&gt; peaks in the peaks workspace have already been indexed, find the UB matrix that corresponds to that indexing.</string>
-             </property>
-             <property name="text">
-              <string>Find UB Using Indexed Peaks</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_23">
-             <item>
-              <spacer name="horizontalSpacer_25">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="IndexedPeaksTolerance_lbl">
-               <property name="text">
-                <string>Tolerance</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_32">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="IndexedPeaksTolerance_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Maximum distance of h,k or l from integer values to&lt;br&gt; consider a peak to be indexed.</string>
-               </property>
-               <property name="text">
-                <string>0.1</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QRadioButton" name="LoadISAWUB_rbtn">
-             <property name="toolTip">
-              <string>Load the UB matrix from a file.</string>
-             </property>
-             <property name="text">
-              <string>Load Isaw UB</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_24">
-             <item>
-              <spacer name="horizontalSpacer_24">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="SelectUBFile_lbl">
-               <property name="text">
-                <string>Filename</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_33">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::MinimumExpanding</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="SelectUBFile_ledt">
-               <property name="toolTip">
-                <string>Name of the file with the UB matrix.</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QPushButton" name="SelectUBFile_btn">
-               <property name="toolTip">
-                <string>Browse for the file with the UB matrix.</string>
-               </property>
-               <property name="text">
-                <string>Browse</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_31">
-             <item>
-              <spacer name="horizontalSpacer_23">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="OptimizeGoniometerAngles_ckbx">
-               <property name="toolTip">
-                <string>Optimize the goniometer&lt;br&gt; angles, to index the peaks as accurately as possible using the UB matrix that was loaded.</string>
-               </property>
-               <property name="text">
-                <string>Optimize Phi, Chi and Omega</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_25">
-             <item>
-              <spacer name="horizontalSpacer_22">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="MaxGoniometerChange_lbl">
-               <property name="text">
-                <string>Maximum Change (degrees)</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_34">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="MaxGoniometerChange_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Maximum number of degrees that CHI, PHI&lt;br&gt; or OMEGA can be changed.</string>
-               </property>
-               <property name="text">
-                <string>5</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_30">
-             <item>
-              <widget class="QRadioButton" name="UseCurrentUB_rbtn">
-               <property name="toolTip">
-                <string>If the peaks workspace&lt;br&gt; already has a UB matrix, just use that UB.</string>
-               </property>
-               <property name="text">
-                <string>Use Current UB (if already found or loaded)</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="Line" name="line">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_29">
-             <item>
-              <widget class="QCheckBox" name="IndexPeaks_ckbx">
-               <property name="toolTip">
-                <string>After obtaining the UB&lt;br&gt; matrix, index the peaks using that UB.</string>
-               </property>
-               <property name="text">
-                <string>Index Peaks Using UB</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_26">
-             <item>
-              <spacer name="horizontalSpacer_20">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="IndexingTolerance_lbl">
-               <property name="text">
-                <string>Indexing Tolerance</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_35">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="IndexingTolerance_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Only set the h,k,l values on peaks for which the maximum distance of h,k or l from integer values&lt;br&gt; is less than this tolerance.</string>
-               </property>
-               <property name="text">
-                <string>0.12</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_28">
-             <item>
-              <spacer name="horizontalSpacer_21">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="RoundHKLs_ckbx">
-               <property name="toolTip">
-                <string>Round the h,k,l values to the nearest integer.</string>
-               </property>
-               <property name="text">
-                <string>Round HKLs</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QCheckBox" name="PredictPeaks_ckbx">
-             <property name="text">
-              <string>Predict Peaks</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_16">
-             <item>
-              <spacer name="horizontalSpacer_91">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="min_pred_wl_lbl">
-               <property name="maximumSize">
-                <size>
-                 <width>160</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>Minimum wavelength</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_64">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="min_pred_wl_ledt">
-               <property name="minimumSize">
-                <size>
-                 <width>146</width>
-                 <height>0</height>
-                </size>
-               </property>
-               <property name="maximumSize">
-                <size>
-                 <width>146</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>0.4</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_17">
-             <item>
-              <spacer name="horizontalSpacer_92">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="max_pred_wl_lbl">
-               <property name="maximumSize">
-                <size>
-                 <width>160</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>Maximum wavelength</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_65">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="max_pred_wl_ledt">
-               <property name="maximumSize">
-                <size>
-                 <width>146</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>3.5</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_18">
-             <item>
-              <spacer name="horizontalSpacer_93">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="min_pred_dspacing_lbl">
-               <property name="maximumSize">
-                <size>
-                 <width>160</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>Minimum d-spacing</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_66">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="min_pred_dspacing_ledt">
-               <property name="maximumSize">
-                <size>
-                 <width>146</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>0.4</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_19">
-             <item>
-              <spacer name="horizontalSpacer_94">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="max_pred_dspacing_lbl">
-               <property name="maximumSize">
-                <size>
-                 <width>160</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>Maximum d-spacing</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_67">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="max_pred_dspacing_ledt">
-               <property name="maximumSize">
-                <size>
-                 <width>146</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>8.5</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <spacer name="verticalSpacer_3">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_27">
-             <item>
-              <spacer name="horizontalSpacer_19">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QPushButton" name="ApplyFindUB_btn">
-               <property name="toolTip">
-                <string>Proceed to actually get the&lt;br&gt; UB matrix and (optionally) index the peaks.</string>
-               </property>
-               <property name="text">
-                <string>Apply</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </widget>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="ChooseCell">
-      <attribute name="title">
-       <string>Choose Cell</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_13">
-       <item>
-        <widget class="QScrollArea" name="scrollArea_3">
-         <property name="frameShape">
-          <enum>QFrame::NoFrame</enum>
-         </property>
-         <property name="frameShadow">
-          <enum>QFrame::Plain</enum>
-         </property>
-         <property name="widgetResizable">
-          <bool>true</bool>
-         </property>
-         <widget class="QWidget" name="scrollAreaWidgetContents_5">
-          <property name="geometry">
-           <rect>
-            <x>0</x>
-            <y>0</y>
-            <width>903</width>
-            <height>708</height>
-           </rect>
+          <property name="widgetResizable">
+           <bool>true</bool>
           </property>
-          <layout class="QVBoxLayout" name="verticalLayout_14">
-           <item>
-            <widget class="QRadioButton" name="ShowPossibleCells_rbtn">
-             <property name="toolTip">
-              <string>Show a list of the possible&lt;br&gt; conventional cells in the MantidPlot Results Log window.  NOTE: The current UB must correspond to a Niggli reduced cell for these to be valid.</string>
-             </property>
-             <property name="text">
-              <string>Show Possible Cells</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_36">
-             <item>
-              <spacer name="horizontalSpacer_38">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="MaxScalarError_lbl">
-               <property name="text">
-                <string>Max Scalar Error       </string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_41">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="MaxScalarError_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Maximum error allowed in the cell&lt;br&gt; scalars.  If this is set very large, all possible conventional cells will be shown, including those that don't really match the current cell.  If this is set too small, the desired correct cell may be missing from the list due to experimental error.  The default value of 0.2 should usually work.</string>
-               </property>
-               <property name="text">
-                <string>0.2</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_35">
-             <item>
-              <spacer name="horizontalSpacer_37">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="BestCellOnly_ckbx">
-               <property name="toolTip">
-                <string>Only show the best fitting&lt;br&gt; cell for each cell type and centering that is in the list of possible cells.</string>
-               </property>
-               <property name="text">
-                <string>Best Only</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_351">
-             <item>
-              <spacer name="horizontalSpacer_371">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="AllowPermutations_ckbx">
-               <property name="toolTip">
-                <string>Allow permutations of conventional cells.</string>
-               </property>
-               <property name="text">
-                <string>Allow Permutations</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QRadioButton" name="SelectCellOfType_rbtn">
-             <property name="toolTip">
-              <string>Transform the current UB&lt;br&gt; matrix and indexing to correspond to the best fitting cell with the specified cell-type and centering.</string>
-             </property>
-             <property name="text">
-              <string>Select Cell of Type</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_33">
-             <item>
-              <spacer name="horizontalSpacer_39">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QComboBox" name="CellType_cmbx">
-               <property name="toolTip">
-                <string>The cell-type to be used.</string>
-               </property>
-               <item>
+          <widget class="QWidget" name="scrollAreaWidgetContents_2">
+           <property name="geometry">
+            <rect>
+             <x>0</x>
+             <y>0</y>
+             <width>903</width>
+             <height>696</height>
+            </rect>
+           </property>
+           <layout class="QVBoxLayout" name="verticalLayout_10">
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_10">
+              <item>
+               <widget class="QLabel" name="PeaksWorkspace_lbl">
+                <property name="text">
+                 <string>Peaks Workspace Name</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_18">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="PeaksWorkspace_ledt">
+                <property name="toolTip">
+                 <string>Name of the peaks workspace to use.  This name is set by default,&lt;br&gt; if data is loaded from an event file and mapped to an MD workspace on the Select Data tab.</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <widget class="Line" name="line_2">
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QRadioButton" name="FindPeaks_rbtn">
+              <property name="toolTip">
+               <string>Search through the MD workspace to find Bragg peaks.</string>
+              </property>
+              <property name="text">
+               <string>Find Peaks</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_11">
+              <item>
+               <spacer name="horizontalSpacer_9">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="MaxABC_lbl">
+                <property name="text">
+                 <string>Estimated Max of a,b,c</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_14">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="MaxABC_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Estimated maximum for real&lt;br&gt; space cell edge length in Angstroms.  This is used to get an approximate lower bound on the possible distances between peaks.</string>
+                </property>
+                <property name="text">
+                 <string>15</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_12">
+              <item>
+               <spacer name="horizontalSpacer_11">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="NumToFind_lbl">
+                <property name="text">
+                 <string>Number of Peaks to Find</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_15">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="NumToFind_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Maximum number of peaks to find.  Boxes with progressively&lt;br&gt; lower local intensity will be tried, until the specified number of peaks is found, or until the intensity falls below the specified Min Intensity.</string>
+                </property>
+                <property name="text">
+                 <string>50</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_13">
+              <item>
+               <spacer name="horizontalSpacer_12">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="MinIntensity_lbl">
+                <property name="text">
+                 <string>Min Intensity(above ave)</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_16">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="MinIntensity_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Lower bound on the local intensity of MD boxes to consider as possible peaks, expressed as a multiple of the overall average intensity of the entire MD workspace region.  Boxes with progressively&lt;br&gt; lower local intensity will be tried, until the specified number of peaks is found, or until the intensity falls below the specified Min Intensity.</string>
+                </property>
+                <property name="text">
+                 <string>10000</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <widget class="QRadioButton" name="UseExistingPeaksWorkspace_rbtn">
+              <property name="toolTip">
+               <string>Use a peaks workspace with peaks that have been&lt;br&gt; been previously found, predicted, or loaded. </string>
+              </property>
+              <property name="text">
+               <string>Use Existing Peaks Workspace</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QRadioButton" name="LoadIsawPeaks_rbtn">
+              <property name="toolTip">
+               <string>Load the peaks workspace from a file of peaks&lt;br&gt; that have been previously found or predicted.</string>
+              </property>
+              <property name="text">
+               <string>Load ISAW Peaks (or Integrate or Nexus) File</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_14">
+              <item>
+               <spacer name="horizontalSpacer_13">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="SelectPeaksFile_lbl">
+                <property name="text">
+                 <string>Filename</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_17">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="SelectPeaksFile_ledt">
+                <property name="toolTip">
+                 <string>Name of the peaks file that should be loaded.</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <widget class="QPushButton" name="SelectPeaksFile_btn">
+                <property name="toolTip">
+                 <string>Browse for the file of peaks to load.</string>
+                </property>
+                <property name="text">
+                 <string>Browse</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <spacer name="verticalSpacer_2">
+              <property name="orientation">
+               <enum>Qt::Vertical</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>20</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_15">
+              <item>
+               <spacer name="horizontalSpacer_8">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QPushButton" name="ApplyFindPeaks_btn">
+                <property name="toolTip">
+                 <string>Proceed to actually get the&lt;br&gt; peaks or use the existing peaks, as specified..</string>
+                </property>
+                <property name="text">
+                 <string>Apply</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+           </layout>
+          </widget>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="FindUB">
+       <attribute name="title">
+        <string>Find UB</string>
+       </attribute>
+       <layout class="QVBoxLayout" name="verticalLayout_11">
+        <item>
+         <widget class="QScrollArea" name="scrollArea_2">
+          <property name="frameShape">
+           <enum>QFrame::NoFrame</enum>
+          </property>
+          <property name="frameShadow">
+           <enum>QFrame::Plain</enum>
+          </property>
+          <property name="widgetResizable">
+           <bool>true</bool>
+          </property>
+          <widget class="QWidget" name="scrollAreaWidgetContents_4">
+           <property name="geometry">
+            <rect>
+             <x>0</x>
+             <y>0</y>
+             <width>903</width>
+             <height>696</height>
+            </rect>
+           </property>
+           <layout class="QVBoxLayout" name="verticalLayout_12">
+            <item>
+             <widget class="QRadioButton" name="FindUBUsingFFT_rbtn">
+              <property name="toolTip">
+               <string>Find a UB matrix using the&lt;br&gt; FindUBUsingFFT algorithm.  This will produce a UB matrix corresponding to the Niggli reduced cell for the lattice.</string>
+              </property>
+              <property name="text">
+               <string>Find UB Using FFT</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_20">
+              <item>
+               <spacer name="horizontalSpacer_28">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="MinD_lbl">
+                <property name="text">
+                 <string>Estimated Lower Bound for a,b,c</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_29">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="MinD_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Set this to a value that is&lt;br&gt; about 50%-90% of the shortest real space edge length, in Angstroms.</string>
+                </property>
+                <property name="text">
+                 <string>3</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_21">
+              <item>
+               <spacer name="horizontalSpacer_27">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="MaxD_lbl">
+                <property name="text">
+                 <string>Estimated Upper Bound for a,b,c</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_30">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="MaxD_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Set this to a value that is&lt;br&gt; about 110%-150% of the longest real space edge length, in Angstroms.</string>
+                </property>
+                <property name="text">
+                 <string>15</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_22">
+              <item>
+               <spacer name="horizontalSpacer_26">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="FFTTolerance_lbl">
+                <property name="text">
+                 <string>Tolerance</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_31">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="FFTTolerance_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Maximum distance of h,k or l from integer values to&lt;br&gt; consider a peak to be indexed.</string>
+                </property>
+                <property name="text">
+                 <string>0.12</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <widget class="QRadioButton" name="FindUBUsingIndexedPeaks_rbtn">
+              <property name="toolTip">
+               <string>Find the UB matrix using the FindUBUsingIndexedPeaks algorithm.  Specifically, if the&lt;br&gt; peaks in the peaks workspace have already been indexed, find the UB matrix that corresponds to that indexing.</string>
+              </property>
+              <property name="text">
+               <string>Find UB Using Indexed Peaks</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_23">
+              <item>
+               <spacer name="horizontalSpacer_25">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="IndexedPeaksTolerance_lbl">
+                <property name="text">
+                 <string>Tolerance</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_32">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="IndexedPeaksTolerance_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Maximum distance of h,k or l from integer values to&lt;br&gt; consider a peak to be indexed.</string>
+                </property>
+                <property name="text">
+                 <string>0.1</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <widget class="QRadioButton" name="LoadISAWUB_rbtn">
+              <property name="toolTip">
+               <string>Load the UB matrix from a file.</string>
+              </property>
+              <property name="text">
+               <string>Load Isaw UB</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_24">
+              <item>
+               <spacer name="horizontalSpacer_24">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="SelectUBFile_lbl">
+                <property name="text">
+                 <string>Filename</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_33">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::MinimumExpanding</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="SelectUBFile_ledt">
+                <property name="toolTip">
+                 <string>Name of the file with the UB matrix.</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <widget class="QPushButton" name="SelectUBFile_btn">
+                <property name="toolTip">
+                 <string>Browse for the file with the UB matrix.</string>
+                </property>
+                <property name="text">
+                 <string>Browse</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_31">
+              <item>
+               <spacer name="horizontalSpacer_23">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QCheckBox" name="OptimizeGoniometerAngles_ckbx">
+                <property name="toolTip">
+                 <string>Optimize the goniometer&lt;br&gt; angles, to index the peaks as accurately as possible using the UB matrix that was loaded.</string>
+                </property>
+                <property name="text">
+                 <string>Optimize Phi, Chi and Omega</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_25">
+              <item>
+               <spacer name="horizontalSpacer_22">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="MaxGoniometerChange_lbl">
+                <property name="text">
+                 <string>Maximum Change (degrees)</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_34">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="MaxGoniometerChange_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Maximum number of degrees that CHI, PHI&lt;br&gt; or OMEGA can be changed.</string>
+                </property>
+                <property name="text">
+                 <string>5</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_30">
+              <item>
+               <widget class="QRadioButton" name="UseCurrentUB_rbtn">
+                <property name="toolTip">
+                 <string>If the peaks workspace&lt;br&gt; already has a UB matrix, just use that UB.</string>
+                </property>
+                <property name="text">
+                 <string>Use Current UB (if already found or loaded)</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <widget class="Line" name="line">
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_29">
+              <item>
+               <widget class="QCheckBox" name="IndexPeaks_ckbx">
+                <property name="toolTip">
+                 <string>After obtaining the UB&lt;br&gt; matrix, index the peaks using that UB.</string>
+                </property>
+                <property name="text">
+                 <string>Index Peaks Using UB</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_26">
+              <item>
+               <spacer name="horizontalSpacer_20">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="IndexingTolerance_lbl">
+                <property name="text">
+                 <string>Indexing Tolerance</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_35">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="IndexingTolerance_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Only set the h,k,l values on peaks for which the maximum distance of h,k or l from integer values&lt;br&gt; is less than this tolerance.</string>
+                </property>
+                <property name="text">
+                 <string>0.12</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_28">
+              <item>
+               <spacer name="horizontalSpacer_21">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QCheckBox" name="RoundHKLs_ckbx">
+                <property name="toolTip">
+                 <string>Round the h,k,l values to the nearest integer.</string>
+                </property>
+                <property name="text">
+                 <string>Round HKLs</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <widget class="QCheckBox" name="PredictPeaks_ckbx">
+              <property name="text">
+               <string>Predict Peaks</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_16">
+              <item>
+               <spacer name="horizontalSpacer_91">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="min_pred_wl_lbl">
+                <property name="maximumSize">
+                 <size>
+                  <width>160</width>
+                  <height>16777215</height>
+                 </size>
+                </property>
+                <property name="text">
+                 <string>Minimum wavelength</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_64">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="min_pred_wl_ledt">
+                <property name="minimumSize">
+                 <size>
+                  <width>146</width>
+                  <height>0</height>
+                 </size>
+                </property>
+                <property name="maximumSize">
+                 <size>
+                  <width>146</width>
+                  <height>16777215</height>
+                 </size>
+                </property>
+                <property name="text">
+                 <string>0.4</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_17">
+              <item>
+               <spacer name="horizontalSpacer_92">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="max_pred_wl_lbl">
+                <property name="maximumSize">
+                 <size>
+                  <width>160</width>
+                  <height>16777215</height>
+                 </size>
+                </property>
+                <property name="text">
+                 <string>Maximum wavelength</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_65">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="max_pred_wl_ledt">
+                <property name="maximumSize">
+                 <size>
+                  <width>146</width>
+                  <height>16777215</height>
+                 </size>
+                </property>
+                <property name="text">
+                 <string>3.5</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_18">
+              <item>
+               <spacer name="horizontalSpacer_93">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="min_pred_dspacing_lbl">
+                <property name="maximumSize">
+                 <size>
+                  <width>160</width>
+                  <height>16777215</height>
+                 </size>
+                </property>
+                <property name="text">
+                 <string>Minimum d-spacing</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_66">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="min_pred_dspacing_ledt">
+                <property name="maximumSize">
+                 <size>
+                  <width>146</width>
+                  <height>16777215</height>
+                 </size>
+                </property>
+                <property name="text">
+                 <string>0.4</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_19">
+              <item>
+               <spacer name="horizontalSpacer_94">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="max_pred_dspacing_lbl">
+                <property name="maximumSize">
+                 <size>
+                  <width>160</width>
+                  <height>16777215</height>
+                 </size>
+                </property>
+                <property name="text">
+                 <string>Maximum d-spacing</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_67">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="max_pred_dspacing_ledt">
+                <property name="maximumSize">
+                 <size>
+                  <width>146</width>
+                  <height>16777215</height>
+                 </size>
+                </property>
+                <property name="text">
+                 <string>8.5</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <spacer name="verticalSpacer_3">
+              <property name="orientation">
+               <enum>Qt::Vertical</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>20</width>
+                <height>40</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_27">
+              <item>
+               <spacer name="horizontalSpacer_19">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QPushButton" name="ApplyFindUB_btn">
+                <property name="toolTip">
+                 <string>Proceed to actually get the&lt;br&gt; UB matrix and (optionally) index the peaks.</string>
+                </property>
+                <property name="text">
+                 <string>Apply</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+           </layout>
+          </widget>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="ChooseCell">
+       <attribute name="title">
+        <string>Choose Cell</string>
+       </attribute>
+       <layout class="QVBoxLayout" name="verticalLayout_13">
+        <item>
+         <widget class="QScrollArea" name="scrollArea_3">
+          <property name="frameShape">
+           <enum>QFrame::NoFrame</enum>
+          </property>
+          <property name="frameShadow">
+           <enum>QFrame::Plain</enum>
+          </property>
+          <property name="widgetResizable">
+           <bool>true</bool>
+          </property>
+          <widget class="QWidget" name="scrollAreaWidgetContents_5">
+           <property name="geometry">
+            <rect>
+             <x>0</x>
+             <y>0</y>
+             <width>903</width>
+             <height>696</height>
+            </rect>
+           </property>
+           <layout class="QVBoxLayout" name="verticalLayout_14">
+            <item>
+             <widget class="QRadioButton" name="ShowPossibleCells_rbtn">
+              <property name="toolTip">
+               <string>Show a list of the possible&lt;br&gt; conventional cells in the MantidPlot Results Log window.  NOTE: The current UB must correspond to a Niggli reduced cell for these to be valid.</string>
+              </property>
+              <property name="text">
+               <string>Show Possible Cells</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_36">
+              <item>
+               <spacer name="horizontalSpacer_38">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="MaxScalarError_lbl">
+                <property name="text">
+                 <string>Max Scalar Error       </string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_41">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="MaxScalarError_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Maximum error allowed in the cell&lt;br&gt; scalars.  If this is set very large, all possible conventional cells will be shown, including those that don't really match the current cell.  If this is set too small, the desired correct cell may be missing from the list due to experimental error.  The default value of 0.2 should usually work.</string>
+                </property>
+                <property name="text">
+                 <string>0.2</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_35">
+              <item>
+               <spacer name="horizontalSpacer_37">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QCheckBox" name="BestCellOnly_ckbx">
+                <property name="toolTip">
+                 <string>Only show the best fitting&lt;br&gt; cell for each cell type and centering that is in the list of possible cells.</string>
+                </property>
+                <property name="text">
+                 <string>Best Only</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_351">
+              <item>
+               <spacer name="horizontalSpacer_371">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QCheckBox" name="AllowPermutations_ckbx">
+                <property name="toolTip">
+                 <string>Allow permutations of conventional cells.</string>
+                </property>
+                <property name="text">
+                 <string>Allow Permutations</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <widget class="QRadioButton" name="SelectCellOfType_rbtn">
+              <property name="toolTip">
+               <string>Transform the current UB&lt;br&gt; matrix and indexing to correspond to the best fitting cell with the specified cell-type and centering.</string>
+              </property>
+              <property name="text">
+               <string>Select Cell of Type</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_33">
+              <item>
+               <spacer name="horizontalSpacer_39">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QComboBox" name="CellType_cmbx">
+                <property name="toolTip">
+                 <string>The cell-type to be used.</string>
+                </property>
+                <item>
+                 <property name="text">
+                  <string>Cubic</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>Hexagonal</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>Monoclinic</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>Orthorhombic</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>Rhombohedral</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>Tetragonal</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>Triclinic</string>
+                 </property>
+                </item>
+               </widget>
+              </item>
+              <item>
+               <widget class="QComboBox" name="CellCentering_cmbx">
+                <property name="toolTip">
+                 <string>The centering to be used.</string>
+                </property>
+                <item>
+                 <property name="text">
+                  <string>C</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>F</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>I</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>P</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>R</string>
+                 </property>
+                </item>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_42">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <widget class="QRadioButton" name="SelectCellWithForm_rbtn">
+              <property name="toolTip">
+               <string>Transform the current UB&lt;br&gt; matrix and indexing to correspond to the cell with the specified Form number, as shown in the list of possible cells.</string>
+              </property>
+              <property name="text">
+               <string>Select Cell With Form</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_34">
+              <item>
+               <spacer name="horizontalSpacer_40">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QComboBox" name="CellFormNumber_cmbx">
+                <property name="toolTip">
+                 <string>The Form number of the&lt;br&gt; desired conventional cell.</string>
+                </property>
+                <item>
+                 <property name="text">
+                  <string>1</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>2</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>3</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>4</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>5</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>6</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>7</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>8</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>9</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>10</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>11</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>12</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>13</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>14</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>15</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>16</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>17</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>18</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>19</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>20</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>21</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>22</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>23</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>24</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>25</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>26</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>27</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>28</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>29</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>30</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>31</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>32</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>33</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>34</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>35</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>36</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>37</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>38</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>39</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>40</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>41</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>42</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>43</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>44</string>
+                 </property>
+                </item>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_43">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <spacer name="verticalSpacer_4">
+              <property name="orientation">
+               <enum>Qt::Vertical</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>20</width>
+                <height>40</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_32">
+              <item>
+               <spacer name="horizontalSpacer_36">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QPushButton" name="ApplyChooseCell_btn">
+                <property name="toolTip">
+                 <string>Proceed to show the&lt;br&gt; possible cells, or change the UB matrix and indexing, according to the options selected.</string>
+                </property>
                 <property name="text">
-                 <string>Cubic</string>
+                 <string>Apply</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+           </layout>
+          </widget>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="ChangeHKL">
+       <attribute name="title">
+        <string>Change HKL</string>
+       </attribute>
+       <layout class="QVBoxLayout" name="verticalLayout_15">
+        <item>
+         <widget class="QScrollArea" name="scrollArea_4">
+          <property name="frameShape">
+           <enum>QFrame::NoFrame</enum>
+          </property>
+          <property name="frameShadow">
+           <enum>QFrame::Plain</enum>
+          </property>
+          <property name="widgetResizable">
+           <bool>true</bool>
+          </property>
+          <widget class="QWidget" name="scrollAreaWidgetContents_6">
+           <property name="geometry">
+            <rect>
+             <x>0</x>
+             <y>0</y>
+             <width>903</width>
+             <height>696</height>
+            </rect>
+           </property>
+           <layout class="QVBoxLayout" name="verticalLayout_16">
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_37">
+              <item>
+               <widget class="QLabel" name="HKL_Transfrom_lbl">
+                <property name="toolTip">
+                 <string>Transform the UB matrix&lt;br&gt; and peak indexes using the specified 3X3 matrix.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>Hexagonal</string>
+                 <string>Specify 3x3 Matrix to Apply to HKL</string>
                 </property>
-               </item>
-               <item>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_38">
+              <item>
+               <spacer name="horizontalSpacer_48">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="HKL_Tran_Row_1_lbl">
                 <property name="text">
-                 <string>Monoclinic</string>
+                 <string>HKL Transformation, Row 1</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_45">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="HKL_tran_row_1_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>First row of the&lt;br&gt; transformation matrix to apply the HKL indexes.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>Orthorhombic</string>
+                 <string>1,  0,  0</string>
                 </property>
-               </item>
-               <item>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_39">
+              <item>
+               <spacer name="horizontalSpacer_49">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="HKL_Tran_Row_2_lbl">
                 <property name="text">
-                 <string>Rhombohedral</string>
+                 <string>HKL Transformation, Row 2</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_46">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="HKL_tran_row_2_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Second row of the&lt;br&gt; transformation matrix to apply the HKL indexes.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>Tetragonal</string>
+                 <string>0,  1,  0</string>
                 </property>
-               </item>
-               <item>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_40">
+              <item>
+               <spacer name="horizontalSpacer_50">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="HKL_Tran_Row_3_lbl">
                 <property name="text">
-                 <string>Triclinic</string>
+                 <string>HKL Transformation, Row 3</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="horizontalSpacer_47">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="HKL_tran_row_3_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Third row of the&lt;br&gt; transformation matrix to apply the HKL indexes.</string>
                 </property>
-               </item>
-              </widget>
-             </item>
-             <item>
-              <widget class="QComboBox" name="CellCentering_cmbx">
-               <property name="toolTip">
-                <string>The centering to be used.</string>
-               </property>
-               <item>
                 <property name="text">
-                 <string>C</string>
+                 <string>0,  0,  1</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <spacer name="verticalSpacer_5">
+              <property name="orientation">
+               <enum>Qt::Vertical</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>20</width>
+                <height>40</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_42">
+              <item>
+               <spacer name="horizontalSpacer_44">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QPushButton" name="ApplyChangeHKL_btn">
+                <property name="toolTip">
+                 <string>Use the specified matrix&lt;br&gt; to update the peak indexes and UB matrix.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>F</string>
+                 <string>Apply</string>
                 </property>
-               </item>
-               <item>
+               </widget>
+              </item>
+             </layout>
+            </item>
+           </layout>
+          </widget>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="Integrate">
+       <attribute name="title">
+        <string>Integrate</string>
+       </attribute>
+       <layout class="QVBoxLayout" name="verticalLayout_18">
+        <item>
+         <widget class="QScrollArea" name="scrollArea_5">
+          <property name="frameShape">
+           <enum>QFrame::NoFrame</enum>
+          </property>
+          <property name="frameShadow">
+           <enum>QFrame::Plain</enum>
+          </property>
+          <property name="widgetResizable">
+           <bool>true</bool>
+          </property>
+          <widget class="QWidget" name="scrollAreaWidgetContents_7">
+           <property name="geometry">
+            <rect>
+             <x>0</x>
+             <y>0</y>
+             <width>903</width>
+             <height>696</height>
+            </rect>
+           </property>
+           <layout class="QVBoxLayout" name="verticalLayout_17">
+            <item>
+             <widget class="QRadioButton" name="SphereIntegration_rbtn">
+              <property name="toolTip">
+               <string>Apply the IntegratePeaksMD&lt;br&gt; algorithm to integrate the current list of peaks, using spherical regions around the peaks in reciprocal space.  This is the fastest of the integration methods. See the algorithm documentation for more details.</string>
+              </property>
+              <property name="text">
+               <string>Spherical or Cylindrical Integration</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_55">
+              <item>
+               <spacer name="horizontalSpacer_63">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="PeakRadius_lbl">
                 <property name="text">
-                 <string>I</string>
+                 <string>Peak Radius (A^-1)</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="PeakRadius_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Radius of the spherical&lt;br&gt; region that will be considered the body of the peak.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>P</string>
+                 <string>0.20</string>
                 </property>
-               </item>
-               <item>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_54">
+              <item>
+               <spacer name="horizontalSpacer_62">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="BackgroundInnerRadius_lbl">
                 <property name="text">
-                 <string>R</string>
+                 <string>Background Inner Radius (A^-1)</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="BackgroundInnerRadius_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Radius of the inner surface&lt;br&gt; of the spherical shell that will be used for the background estimate.</string>
                 </property>
-               </item>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_42">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QRadioButton" name="SelectCellWithForm_rbtn">
-             <property name="toolTip">
-              <string>Transform the current UB&lt;br&gt; matrix and indexing to correspond to the cell with the specified Form number, as shown in the list of possible cells.</string>
-             </property>
-             <property name="text">
-              <string>Select Cell With Form</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_34">
-             <item>
-              <spacer name="horizontalSpacer_40">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QComboBox" name="CellFormNumber_cmbx">
-               <property name="toolTip">
-                <string>The Form number of the&lt;br&gt; desired conventional cell.</string>
-               </property>
-               <item>
                 <property name="text">
-                 <string>1</string>
+                 <string>0.20</string>
                 </property>
-               </item>
-               <item>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_53">
+              <item>
+               <spacer name="horizontalSpacer_61">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="BackgroundOuterRadius_lbl">
                 <property name="text">
-                 <string>2</string>
+                 <string>Background Outer Radius (A^-1)</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="BackgroundOuterRadius_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Radius of the outer surface&lt;br&gt; of the spherical shell that will be used for the background estimate.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>3</string>
+                 <string>0.25</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_52">
+              <item>
+               <spacer name="horizontalSpacer_55">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QCheckBox" name="IntegrateEdge_ckbx">
+                <property name="toolTip">
+                 <string>If true, all peaks will be&lt;br&gt; integrated.  If false, any peak for which the background shell goes off the edge of the detector will not be integrated.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>4</string>
+                 <string>Integrate if on Edge</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <widget class="QCheckBox" name="Cylinder_ckbx">
+                <property name="toolTip">
+                 <string>If true, cylinder instead of sphere..</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>5</string>
+                 <string>Integrate with cylinder</string>
                 </property>
-               </item>
-               <item>
+               </widget>
+              </item>
+              <item>
+               <widget class="QComboBox" name="CylinderProfileFit_cmbx">
+                <property name="toolTip">
+                 <string>Fit cylinder profile with function</string>
+                </property>
+                <item>
+                 <property name="text">
+                  <string>BackToBackExponential</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>Bk2BKExpConvPV</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>DeltaFunction</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>ElasticDiffSphere</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>ExamplePeakFunction</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>Gaussian</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>IkedaCarpenterPV</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>Lorentzian</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>NoFit</string>
+                 </property>
+                </item>
+                <item>
+                 <property name="text">
+                  <string>Voigt</string>
+                 </property>
+                </item>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_53a">
+              <item>
+               <spacer name="horizontalSpacer_61a">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="CylinderLength_lbl">
                 <property name="text">
-                 <string>6</string>
+                 <string>Cylinder Length (A^-1)</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="CylinderLength_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Length of the cylinder used for integration.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>7</string>
+                 <string>0.4</string>
                 </property>
-               </item>
-               <item>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_53b">
+              <item>
+               <spacer name="horizontalSpacer_61b">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="CylinderPercentBkg_lbl">
                 <property name="text">
-                 <string>8</string>
+                 <string>Percent of cylinder length that is background.</string>
                 </property>
-               </item>
-               <item>
+               </widget>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="CylinderPercentBkg_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Radius of the outer surface&lt;br&gt; of the spherical shell that will be used for the background estimate.</string>
+                </property>
+                <property name="text">
+                 <string>0.25</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <widget class="QRadioButton" name="TwoDFitIntegration_rbtn">
+              <property name="toolTip">
+               <string>Apply the PeakIntegration&lt;br&gt; algorithm to integrate the current list of peaks, by combining the integrated intensities on multiple time-of-flight slices. This method is much slower than the Spherical Integration method, so please allow time for the calculation to complete.  See the algorithm documentation for more details.</string>
+              </property>
+              <property name="text">
+               <string>2-D Fitting Integration</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_51">
+              <item>
+               <spacer name="horizontalSpacer_60">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="FitRebinParams_lbl">
                 <property name="text">
-                 <string>9</string>
+                 <string>Rebin Parameters</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="FitRebinParams_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>Parameters used to form&lt;br&gt; histograms from the event data.  The first and last values are the start and end times-of-flight.  The middle value is the step size.  If the step size is negative it represents the decimal fraction increase in the bin boundary at each step, instead of the actual bin size.</string>
+                </property>
+                <property name="text">
+                 <string>1000,-0.004,16000</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_50">
+              <item>
+               <spacer name="horizontalSpacer_59">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="NBadEdgePixels_lbl">
+                <property name="text">
+                 <string>Number of Bad Edge Pixels</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="NBadEdgePixels_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="toolTip">
+                 <string>The width of the border of&lt;br&gt; bad pixels around the edge of each detector that should be omitted.</string>
+                </property>
+                <property name="text">
+                 <string>5</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_49">
+              <item>
+               <spacer name="horizontalSpacer_54">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QCheckBox" name="IkedaCarpenter_ckbx">
+                <property name="toolTip">
+                 <string>If true, the Ikeda-Carpenter&lt;br&gt; function will be used to fit the results of integrating the various time-of-flight slices, to obtain the final integrated result.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>10</string>
+                 <string>Ikeda-Carpenter TOF</string>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>11</string>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <widget class="QRadioButton" name="EllipsoidIntegration_rbtn">
+              <property name="toolTip">
+               <string>Apply the IntegrateEllipsoids&lt;br&gt; algorithm to integrate the current list of peaks, by finding the principal axes of the 3D events in regions around each peak.  This method is a little slower than the Spherical Integration method.  See the algorithm documentation for more details.</string>
+              </property>
+              <property name="text">
+               <string>Ellipsoidal Integration (Integer HKL only)</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_48">
+              <item>
+               <spacer name="horizontalSpacer_58">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>12</string>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>13</string>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
                 </property>
-               </item>
-               <item>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="RegionRadius_lbl">
                 <property name="text">
-                 <string>14</string>
+                 <string>Region Radius (A^-1)</string>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>15</string>
+               </widget>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="RegionRadius_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>16</string>
+                <property name="toolTip">
+                 <string>Radius of a spherical region&lt;br&gt; around each peak that will be used when finding the principal axes.  This should be large enough to include the entire peak and nearby background region, but not much larger.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>17</string>
+                 <string>0.25</string>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>18</string>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_47">
+              <item>
+               <spacer name="horizontalSpacer_52">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>19</string>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>20</string>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>15</width>
+                  <height>0</height>
+                 </size>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>21</string>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QCheckBox" name="SpecifySize_ckbx">
+                <property name="toolTip">
+                 <string>If this is set true, the major axis&lt;br&gt; size of each ellipsoidal region will be constant for all peaks, and will be set by the following three parameters.  If this is set false, the major axis sizes will be calculated based on the standard deviation in the direction of the major axis.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>22</string>
+                 <string>Specify Size</string>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>23</string>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_46">
+              <item>
+               <spacer name="horizontalSpacer_57">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>24</string>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>25</string>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>0</height>
+                 </size>
                 </property>
-               </item>
-               <item>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="PeakSize_lbl">
                 <property name="text">
-                 <string>26</string>
+                 <string>Peak Size (A^-1)</string>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>27</string>
+               </widget>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="PeakSize_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>28</string>
+                <property name="toolTip">
+                 <string>Length of the major axis&lt;br&gt; to use for the ellipsoidal peak region.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>29</string>
+                 <string>0.20</string>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>30</string>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_45">
+              <item>
+               <spacer name="horizontalSpacer_56">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>31</string>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>32</string>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>0</height>
+                 </size>
                 </property>
-               </item>
-               <item>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="BackgroundInnerSize_lbl">
                 <property name="text">
-                 <string>33</string>
+                 <string>Background Inner Size (A^-1)</string>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>34</string>
+               </widget>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="BackgroundInnerSize_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>35</string>
+                <property name="toolTip">
+                 <string>Length of the major axis&lt;br&gt; of the inner surface of the ellipsoidal shell used for the background region.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>36</string>
+                 <string>0.20</string>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>37</string>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_44">
+              <item>
+               <spacer name="horizontalSpacer_53">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>38</string>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>39</string>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>0</height>
+                 </size>
                 </property>
-               </item>
-               <item>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="BackgroundOuterSize_lbl">
                 <property name="text">
-                 <string>40</string>
+                 <string>Background Outer Size (A^-1) </string>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>41</string>
+               </widget>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="BackgroundOuterSize_ledt">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>42</string>
+                <property name="toolTip">
+                 <string>Length of the major axis&lt;br&gt; of the outer surface of the ellipsoidal shell used for the background region.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>43</string>
+                 <string>0.25</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item>
+             <spacer name="verticalSpacer_6">
+              <property name="orientation">
+               <enum>Qt::Vertical</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>20</width>
+                <height>40</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_43">
+              <item>
+               <spacer name="horizontalSpacer_51">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>40</width>
+                  <height>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QPushButton" name="ApplyIntegrate_btn">
+                <property name="toolTip">
+                 <string>Proceed to actually do the peak integration as specified.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>44</string>
+                 <string>Apply</string>
                 </property>
-               </item>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_43">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <spacer name="verticalSpacer_4">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_32">
-             <item>
-              <spacer name="horizontalSpacer_36">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QPushButton" name="ApplyChooseCell_btn">
-               <property name="toolTip">
-                <string>Proceed to show the&lt;br&gt; possible cells, or change the UB matrix and indexing, according to the options selected.</string>
-               </property>
-               <property name="text">
-                <string>Apply</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-          </layout>
+               </widget>
+              </item>
+             </layout>
+            </item>
+           </layout>
+          </widget>
          </widget>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="ChangeHKL">
-      <attribute name="title">
-       <string>Change HKL</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_15">
-       <item>
-        <widget class="QScrollArea" name="scrollArea_4">
-         <property name="frameShape">
-          <enum>QFrame::NoFrame</enum>
-         </property>
-         <property name="frameShadow">
-          <enum>QFrame::Plain</enum>
-         </property>
-         <property name="widgetResizable">
-          <bool>true</bool>
-         </property>
-         <widget class="QWidget" name="scrollAreaWidgetContents_6">
-          <property name="geometry">
-           <rect>
-            <x>0</x>
-            <y>0</y>
-            <width>903</width>
-            <height>708</height>
-           </rect>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="PointInfo_tab">
+       <attribute name="title">
+        <string>Point Info</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_3">
+        <item row="0" column="0">
+         <widget class="QGroupBox" name="SelectedPoint_grpbx">
+          <property name="title">
+           <string>Selected Point Info</string>
           </property>
-          <layout class="QVBoxLayout" name="verticalLayout_16">
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_37">
-             <item>
-              <widget class="QLabel" name="HKL_Transfrom_lbl">
-               <property name="toolTip">
-                <string>Transform the UB matrix&lt;br&gt; and peak indexes using the specified 3X3 matrix.</string>
-               </property>
-               <property name="text">
-                <string>Specify 3x3 Matrix to Apply to HKL</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_38">
-             <item>
-              <spacer name="horizontalSpacer_48">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="HKL_Tran_Row_1_lbl">
-               <property name="text">
-                <string>HKL Transformation, Row 1</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_45">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="HKL_tran_row_1_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>First row of the&lt;br&gt; transformation matrix to apply the HKL indexes.</string>
-               </property>
-               <property name="text">
-                <string>1,  0,  0</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_39">
-             <item>
-              <spacer name="horizontalSpacer_49">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="HKL_Tran_Row_2_lbl">
-               <property name="text">
-                <string>HKL Transformation, Row 2</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_46">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="HKL_tran_row_2_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Second row of the&lt;br&gt; transformation matrix to apply the HKL indexes.</string>
-               </property>
-               <property name="text">
-                <string>0,  1,  0</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_40">
-             <item>
-              <spacer name="horizontalSpacer_50">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="HKL_Tran_Row_3_lbl">
-               <property name="text">
-                <string>HKL Transformation, Row 3</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_47">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="HKL_tran_row_3_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Third row of the&lt;br&gt; transformation matrix to apply the HKL indexes.</string>
-               </property>
-               <property name="text">
-                <string>0,  0,  1</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <spacer name="verticalSpacer_5">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
+          <layout class="QVBoxLayout" name="verticalLayout_2">
            <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_42">
-             <item>
-              <spacer name="horizontalSpacer_44">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QPushButton" name="ApplyChangeHKL_btn">
-               <property name="toolTip">
-                <string>Use the specified matrix&lt;br&gt; to update the peak indexes and UB matrix.</string>
-               </property>
-               <property name="text">
-                <string>Apply</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
+            <widget class="QTableWidget" name="SelectedPoint_tbl"/>
            </item>
-          </layout>
-         </widget>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="Integrate">
-      <attribute name="title">
-       <string>Integrate</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_18">
-       <item>
-        <widget class="QScrollArea" name="scrollArea_5">
-         <property name="frameShape">
-          <enum>QFrame::NoFrame</enum>
-         </property>
-         <property name="frameShadow">
-          <enum>QFrame::Plain</enum>
-         </property>
-         <property name="widgetResizable">
-          <bool>true</bool>
-         </property>
-         <widget class="QWidget" name="scrollAreaWidgetContents_7">
-          <property name="geometry">
-           <rect>
-            <x>0</x>
-            <y>0</y>
-            <width>903</width>
-            <height>708</height>
-           </rect>
-          </property>
-          <layout class="QVBoxLayout" name="verticalLayout_17">
            <item>
-            <widget class="QRadioButton" name="SphereIntegration_rbtn">
-             <property name="toolTip">
-              <string>Apply the IntegratePeaksMD&lt;br&gt; algorithm to integrate the current list of peaks, using spherical regions around the peaks in reciprocal space.  This is the fastest of the integration methods. See the algorithm documentation for more details.</string>
-             </property>
-             <property name="text">
-              <string>Spherical or Cylindrical Integration</string>
+            <widget class="QGroupBox" name="groupBox">
+             <property name="title">
+              <string>Specify Qx Qy Qz</string>
              </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_55">
-             <item>
-              <spacer name="horizontalSpacer_63">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="PeakRadius_lbl">
-               <property name="text">
-                <string>Peak Radius (A^-1)</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="PeakRadius_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Radius of the spherical&lt;br&gt; region that will be considered the body of the peak.</string>
-               </property>
-               <property name="text">
-                <string>0.20</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_54">
-             <item>
-              <spacer name="horizontalSpacer_62">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="BackgroundInnerRadius_lbl">
-               <property name="text">
-                <string>Background Inner Radius (A^-1)</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="BackgroundInnerRadius_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Radius of the inner surface&lt;br&gt; of the spherical shell that will be used for the background estimate.</string>
-               </property>
-               <property name="text">
-                <string>0.20</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_53">
-             <item>
-              <spacer name="horizontalSpacer_61">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="BackgroundOuterRadius_lbl">
-               <property name="text">
-                <string>Background Outer Radius (A^-1)</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="BackgroundOuterRadius_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Radius of the outer surface&lt;br&gt; of the spherical shell that will be used for the background estimate.</string>
-               </property>
-               <property name="text">
-                <string>0.25</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_52">
-             <item>
-              <spacer name="horizontalSpacer_55">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="IntegrateEdge_ckbx">
-               <property name="toolTip">
-                <string>If true, all peaks will be&lt;br&gt; integrated.  If false, any peak for which the background shell goes off the edge of the detector will not be integrated.</string>
-               </property>
-               <property name="text">
-                <string>Integrate if on Edge</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="Cylinder_ckbx">
-               <property name="toolTip">
-                <string>If true, cylinder instead of sphere..</string>
-               </property>
-               <property name="text">
-                <string>Integrate with cylinder</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QComboBox" name="CylinderProfileFit_cmbx">
-               <property name="toolTip">
-                <string>Fit cylinder profile with function</string>
-               </property>
-               <item>
-                <property name="text">
-                 <string>BackToBackExponential</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Bk2BKExpConvPV</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>DeltaFunction</string>
+             <layout class="QHBoxLayout" name="horizontalLayout">
+              <item>
+               <widget class="QLineEdit" name="Qx_ledt">
+                <property name="toolTip">
+                 <string>The X-coordinate of a point&lt;br&gt; of interest in reciprocal space specified in lab coordinates.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>ElasticDiffSphere</string>
+                 <string>0.0</string>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>ExamplePeakFunction</string>
+               </widget>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="Qy_ledt">
+                <property name="toolTip">
+                 <string>The Y-coordinate of a point&lt;br&gt; of interest in reciprocal space specified in lab coordinates.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>Gaussian</string>
+                 <string>0.0</string>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>IkedaCarpenterPV</string>
+               </widget>
+              </item>
+              <item>
+               <widget class="QLineEdit" name="Qz_ledt">
+                <property name="toolTip">
+                 <string>The Z-coordinate of a point&lt;br&gt; of interest in reciprocal space specified in lab coordinates.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>Lorentzian</string>
+                 <string>0.0</string>
                 </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>NoFit</string>
+               </widget>
+              </item>
+              <item>
+               <widget class="QPushButton" name="ShowInfo_btn">
+                <property name="toolTip">
+                 <string>Press this after entering&lt;br&gt; Qx,Qy,Qz in lab coordinates to display information about that point in the Selected Point Info table.</string>
                 </property>
-               </item>
-               <item>
                 <property name="text">
-                 <string>Voigt</string>
+                 <string>Show Info</string>
                 </property>
-               </item>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_53a">
-             <item>
-              <spacer name="horizontalSpacer_61a">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="CylinderLength_lbl">
-               <property name="text">
-                <string>Cylinder Length (A^-1)</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="CylinderLength_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Length of the cylinder used for integration.</string>
-               </property>
-               <property name="text">
-                <string>0.4</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_53b">
-             <item>
-              <spacer name="horizontalSpacer_61b">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="CylinderPercentBkg_lbl">
-               <property name="text">
-                <string>Percent of cylinder length that is background.</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="CylinderPercentBkg_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Radius of the outer surface&lt;br&gt; of the spherical shell that will be used for the background estimate.</string>
-               </property>
-               <property name="text">
-                <string>0.25</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QRadioButton" name="TwoDFitIntegration_rbtn">
-             <property name="toolTip">
-              <string>Apply the PeakIntegration&lt;br&gt; algorithm to integrate the current list of peaks, by combining the integrated intensities on multiple time-of-flight slices. This method is much slower than the Spherical Integration method, so please allow time for the calculation to complete.  See the algorithm documentation for more details.</string>
-             </property>
-             <property name="text">
-              <string>2-D Fitting Integration</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_51">
-             <item>
-              <spacer name="horizontalSpacer_60">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="FitRebinParams_lbl">
-               <property name="text">
-                <string>Rebin Parameters</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="FitRebinParams_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Parameters used to form&lt;br&gt; histograms from the event data.  The first and last values are the start and end times-of-flight.  The middle value is the step size.  If the step size is negative it represents the decimal fraction increase in the bin boundary at each step, instead of the actual bin size.</string>
-               </property>
-               <property name="text">
-                <string>1000,-0.004,16000</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_50">
-             <item>
-              <spacer name="horizontalSpacer_59">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="NBadEdgePixels_lbl">
-               <property name="text">
-                <string>Number of Bad Edge Pixels</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="NBadEdgePixels_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>The width of the border of&lt;br&gt; bad pixels around the edge of each detector that should be omitted.</string>
-               </property>
-               <property name="text">
-                <string>5</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_49">
-             <item>
-              <spacer name="horizontalSpacer_54">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="IkedaCarpenter_ckbx">
-               <property name="toolTip">
-                <string>If true, the Ikeda-Carpenter&lt;br&gt; function will be used to fit the results of integrating the various time-of-flight slices, to obtain the final integrated result.</string>
-               </property>
-               <property name="text">
-                <string>Ikeda-Carpenter TOF</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QRadioButton" name="EllipsoidIntegration_rbtn">
-             <property name="toolTip">
-              <string>Apply the IntegrateEllipsoids&lt;br&gt; algorithm to integrate the current list of peaks, by finding the principal axes of the 3D events in regions around each peak.  This method is a little slower than the Spherical Integration method.  See the algorithm documentation for more details.</string>
-             </property>
-             <property name="text">
-              <string>Ellipsoidal Integration (Integer HKL only)</string>
-             </property>
+               </widget>
+              </item>
+             </layout>
             </widget>
            </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_48">
-             <item>
-              <spacer name="horizontalSpacer_58">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="RegionRadius_lbl">
-               <property name="text">
-                <string>Region Radius (A^-1)</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="RegionRadius_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Radius of a spherical region&lt;br&gt; around each peak that will be used when finding the principal axes.  This should be large enough to include the entire peak and nearby background region, but not much larger.</string>
-               </property>
-               <property name="text">
-                <string>0.25</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_47">
-             <item>
-              <spacer name="horizontalSpacer_52">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>15</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="SpecifySize_ckbx">
-               <property name="toolTip">
-                <string>If this is set true, the major axis&lt;br&gt; size of each ellipsoidal region will be constant for all peaks, and will be set by the following three parameters.  If this is set false, the major axis sizes will be calculated based on the standard deviation in the direction of the major axis.</string>
-               </property>
-               <property name="text">
-                <string>Specify Size</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_46">
-             <item>
-              <spacer name="horizontalSpacer_57">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="PeakSize_lbl">
-               <property name="text">
-                <string>Peak Size (A^-1)</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="PeakSize_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Length of the major axis&lt;br&gt; to use for the ellipsoidal peak region.</string>
-               </property>
-               <property name="text">
-                <string>0.20</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_45">
-             <item>
-              <spacer name="horizontalSpacer_56">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="BackgroundInnerSize_lbl">
-               <property name="text">
-                <string>Background Inner Size (A^-1)</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="BackgroundInnerSize_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Length of the major axis&lt;br&gt; of the inner surface of the ellipsoidal shell used for the background region.</string>
-               </property>
-               <property name="text">
-                <string>0.20</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_44">
-             <item>
-              <spacer name="horizontalSpacer_53">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="BackgroundOuterSize_lbl">
-               <property name="text">
-                <string>Background Outer Size (A^-1) </string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="BackgroundOuterSize_ledt">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string>Length of the major axis&lt;br&gt; of the outer surface of the ellipsoidal shell used for the background region.</string>
-               </property>
-               <property name="text">
-                <string>0.25</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <spacer name="verticalSpacer_6">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_43">
-             <item>
-              <spacer name="horizontalSpacer_51">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QPushButton" name="ApplyIntegrate_btn">
-               <property name="toolTip">
-                <string>Proceed to actually do the peak integration as specified.</string>
-               </property>
-               <property name="text">
-                <string>Apply</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
           </layout>
          </widget>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="PointInfo_tab">
-      <attribute name="title">
-       <string>Point Info</string>
-      </attribute>
-      <layout class="QGridLayout" name="gridLayout_3">
-       <item row="0" column="0">
-        <widget class="QGroupBox" name="SelectedPoint_grpbx">
-         <property name="title">
-          <string>Selected Point Info</string>
-         </property>
-         <layout class="QVBoxLayout" name="verticalLayout_2">
-          <item>
-           <widget class="QTableWidget" name="SelectedPoint_tbl"/>
-          </item>
-          <item>
-           <widget class="QGroupBox" name="groupBox">
-            <property name="title">
-             <string>Specify Qx Qy Qz</string>
-            </property>
-            <layout class="QHBoxLayout" name="horizontalLayout">
-             <item>
-              <widget class="QLineEdit" name="Qx_ledt">
-               <property name="toolTip">
-                <string>The X-coordinate of a point&lt;br&gt; of interest in reciprocal space specified in lab coordinates.</string>
-               </property>
-               <property name="text">
-                <string>0.0</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="Qy_ledt">
-               <property name="toolTip">
-                <string>The Y-coordinate of a point&lt;br&gt; of interest in reciprocal space specified in lab coordinates.</string>
-               </property>
-               <property name="text">
-                <string>0.0</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="Qz_ledt">
-               <property name="toolTip">
-                <string>The Z-coordinate of a point&lt;br&gt; of interest in reciprocal space specified in lab coordinates.</string>
-               </property>
-               <property name="text">
-                <string>0.0</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QPushButton" name="ShowInfo_btn">
-               <property name="toolTip">
-                <string>Press this after entering&lt;br&gt; Qx,Qy,Qz in lab coordinates to display information about that point in the Selected Point Info table.</string>
-               </property>
-               <property name="text">
-                <string>Show Info</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-       </item>
-      </layout>
+        </item>
+       </layout>
+      </widget>
      </widget>
-    </widget>
-   </item>
-  </layout>
-  </widget>
-  <widget class="QStatusBar" name="statusbar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>3</width>
-     <height>27</height>
-    </rect>
-   </property>
+    </item>
+   </layout>
   </widget>
+  <widget class="QStatusBar" name="statusbar"/>
   <action name="actionSave_State">
    <property name="text">
     <string>Save Settings</string>
@@ -3529,6 +3522,16 @@
     <string>Online Help Page</string>
    </property>
   </action>
+  <action name="actionSave_Nexus_Peaks">
+   <property name="text">
+    <string>Save Nexus Peaks</string>
+   </property>
+  </action>
+  <action name="actionLoad_Nexus_Peaks">
+   <property name="text">
+    <string>Load Nexus Peaks</string>
+   </property>
+  </action>
  </widget>
  <resources/>
  <connections/>
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEVWorker.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEVWorker.h
index af3a2a596b9f7a586c39a05f0975e6e6e2f02ab6..5f92a905fa2eb2ad2d050a7bdb9ae23c4fc470f6 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEVWorker.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEVWorker.h
@@ -95,11 +95,19 @@ public:
   bool loadIsawPeaks( const std::string & peaks_ws_name,
                       const std::string & file_name );
 
+  bool loadNexusPeaks( const std::string & peaks_ws_name,
+                                      const std::string & file_name );
+
   /// Save the peaks workspace to a .peaks or .integrate file
   bool saveIsawPeaks( const std::string & peaks_ws_name,
                       const std::string & file_name,
                             bool          append );
 
+  /// Save the peaks workspace to a .nxs file
+  bool saveNexusPeaks( const std::string & peaks_ws_name,
+                      const std::string & file_name,
+                            bool          append );
+
   /// Index the peaks using the FFT method
   bool findUBUsingFFT( const std::string & peaks_ws_name,
                        double              min_abc,
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.h
index c4c76a2f20c0180b275673952ec0dba2975747a7..61187efc11761ce0a0e6ec0a81ef74872f2fba7f 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.h
@@ -67,6 +67,7 @@ namespace CustomInterfaces
     void deleteSectionSelector(int index);
     void updateSectionSelector(int index, SectionSelector values);
     void displayError(const QString& message);
+    void help();
   // -- End of IALCBaselineModellingView interface -------------------------------------------------
 
   private slots:
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.ui
index eefba920a9c76ae708c89a6f212140da536f0881..cd4faa0b2f67b33381356e619be601629134b162 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.ui
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.ui
@@ -92,7 +92,20 @@
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout_2">
-         <item>
+          <item>
+            <widget class="QPushButton" name="help">
+              <property name="maximumSize">
+                <size>
+                  <width>25</width>
+                  <height>25</height>
+                </size>
+              </property>
+              <property name="text">
+                <string>?</string>
+              </property>
+            </widget>
+          </item>
+          <item>
           <spacer name="horizontalSpacer">
            <property name="orientation">
             <enum>Qt::Horizontal</enum>
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h
index c7c9ea26d321523b394438358e7528c48ef4ff2f..119a4b206db4cbd5f13e90c4cfb44a8f39d1b84e 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h
@@ -68,8 +68,11 @@ namespace CustomInterfaces
     void displayError(const std::string &error);
     void setAvailableLogs(const std::vector<std::string> &logs);
     void setAvailablePeriods(const std::vector<std::string> &periods);
+    void setTimeLimits(double tMin, double tMax);
+    void setTimeRange (double tMin, double tMax);
     void setWaitingCursor();
     void restoreCursor();
+    void help();
 
     // -- End of IALCDataLoadingView interface -----------------------------------------------------
 
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui
index 99c554af2ebbfbff061e9e55efe5fbbaa1b39386..ebd0214679a8790968ec3c8b6f175f30520d54a4 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui
@@ -387,7 +387,17 @@
                                 </widget>
                               </item>
                               <item>
-                                <widget class="QDoubleSpinBox" name="minTime"/>
+                                <widget class="QDoubleSpinBox" name="minTime">
+                                  <property name="minimum">
+                                    <double>-6</double>
+                                  </property>
+                                  <property name="maximum">
+                                    <double>33</double>
+                                  </property>
+                                  <property name="decimals">
+                                    <number>3</number>
+                                  </property>
+                                </widget>
                               </item>
                               <item>
                                 <widget class="QLabel" name="label_5">
@@ -397,7 +407,17 @@
                                 </widget>
                               </item>
                               <item>
-                                <widget class="QDoubleSpinBox" name="maxTime"/>
+                                <widget class="QDoubleSpinBox" name="maxTime">
+                                  <property name="minimum">
+                                    <double>-6</double>
+                                  </property>
+                                  <property name="maximum">
+                                    <double>33</double>
+                                  </property>
+                                  <property name="decimals">
+                                    <number>3</number>
+                                  </property>
+                                </widget>
                               </item>
                             </layout>
                           </widget>
@@ -435,6 +455,19 @@
               </item>
               <item>
                 <layout class="QHBoxLayout" name="horizontalLayout_3">
+                  <item>
+                    <widget class="QPushButton" name="help">
+                      <property name="maximumSize">
+                        <size>
+                          <width>25</width>
+                          <height>25</height>
+                        </size>
+                      </property>
+                      <property name="text">
+                        <string>?</string>
+                      </property>
+                    </widget>
+                  </item>
                   <item>
                     <spacer name="horizontalSpacer">
                       <property name="orientation">
@@ -498,6 +531,7 @@
     <tabstop>differential</tabstop>
     <tabstop>minTime</tabstop>
     <tabstop>maxTime</tabstop>
+    <tabstop>help</tabstop>
     <tabstop>load</tabstop>
   </tabstops>
   <resources/>
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.h
index 50bba6a0348f42fb87f0e6b892b4a32c23c27ed8..4768632e3b7790dba370202c497aee51d41ece50 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.h
@@ -59,6 +59,7 @@ namespace CustomInterfaces
     void setParameter(const QString& funcIndex, const QString& paramName, double value);
     void setPeakPickerEnabled(bool enabled);
     void setPeakPicker(const IPeakFunction_const_sptr& peak);
+    void help();
 
     // -- End of IALCPeakFitting interface ---------------------------------------------------------
 
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.ui
index 3e078a57def0fb6e9634c7e22aeab8e36d4affc2..6b78d095490f41f27f73690539b857a8b84b1319 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.ui
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.ui
@@ -36,7 +36,20 @@
        </item>
        <item>
         <layout class="QHBoxLayout" name="horizontalLayout">
-         <item>
+          <item>
+            <widget class="QPushButton" name="help">
+              <property name="maximumSize">
+                <size>
+                  <width>25</width>
+                  <height>25</height>
+                </size>
+              </property>
+              <property name="text">
+                <string>?</string>
+              </property>
+            </widget>
+          </item>
+          <item>
           <spacer name="horizontalSpacer">
            <property name="orientation">
             <enum>Qt::Horizontal</enum>
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCBaselineModellingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCBaselineModellingView.h
index b158aa6311b29a24b53f176e116d909dfd539741..1c385f48460270788000a5c5011cbeff26e33ddf 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCBaselineModellingView.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCBaselineModellingView.h
@@ -131,6 +131,9 @@ namespace CustomInterfaces
      */
     virtual void displayError(const QString& message) = 0;
 
+    /// Links help button to wiki page
+    virtual void help() = 0;
+
   signals:
     /// Fit requested
     void fitRequested();
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCDataLoadingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCDataLoadingView.h
index bf6bbc99ad8a15edee68eea6b281e3e51007ce34..54ec12db0a804fe6e9a5667054c5f37bdf52116f 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCDataLoadingView.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCDataLoadingView.h
@@ -103,18 +103,32 @@ namespace CustomInterfaces
     /// @param periods :: New list of periods
     virtual void setAvailablePeriods(const std::vector<std::string>& periods) = 0;
 
+    /// Update the time limits
+    /// @param tMin :: Minimum X value available
+    /// @param tMax :: Maximum X value available
+    virtual void setTimeLimits(double tMin, double tMax) = 0;
+
+    /// Update the time limits
+    /// @param tMin :: Minimum X value available
+    /// @param tMax :: Maximum X value available
+    virtual void setTimeRange(double tMin, double tMax) = 0;
+
     /// Set waiting cursor for long operation
     virtual void setWaitingCursor() = 0;
 
     /// Restore the original cursor
     virtual void restoreCursor() = 0;
 
+    /// Opens the Mantid Wiki web page
+    virtual void help() = 0;
+
   signals:
     /// Request to load data
     void loadRequested();
 
     /// User has selected the first run
     void firstRunSelected();
+
   };
 
 } // namespace CustomInterfaces
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCPeakFittingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCPeakFittingView.h
index 150bdc6850ff9353358c313586c78aed96e4e6da..34a4704f73582f8e8db260a0b73dcfad0aea9097 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCPeakFittingView.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCPeakFittingView.h
@@ -86,6 +86,9 @@ namespace CustomInterfaces
     /// @param peak :: A new peak to represent
     virtual void setPeakPicker(const IPeakFunction_const_sptr& peak) = 0;
 
+    /// Opens the Mantid Wiki web page
+    virtual void help() = 0;
+
   signals:
     /// Request to perform peak fitting
     void fitRequested();
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSRunWindow.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSRunWindow.h
index 5535d1f82c211c3c6857dabdda0e1e6b5bffc610..c8bf9318f1bab48052e05f9d991d10d79f1834df 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSRunWindow.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSRunWindow.h
@@ -105,7 +105,7 @@ private:
   enum Tab
   { 
     RUN_NUMBERS, REDUCTION_SETTINGS, GEOMETRY, MASKING, 
-    LOGGING, ADD_RUNS, DIAGNOSTICS, ONE_D_ANALYSIS, 
+    LOGGING, ADD_RUNS, DIAGNOSTICS, ONE_D_ANALYSIS 
   };
 
   /// Initialize the layout
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/DataComparison.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/DataComparison.cpp
index ef9f33f7c4f1b33132aa670fdb3de9434659704b..240476a99036c5c7b49b8b01c4ad1ea6aa630814 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/DataComparison.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/DataComparison.cpp
@@ -17,7 +17,7 @@ namespace MantidQt
 {
 namespace CustomInterfaces
 {
-  DECLARE_SUBWINDOW(DataComparison);
+  DECLARE_SUBWINDOW(DataComparison)
 }
 }
 
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp
index 2220d18b31e6bf0e1e51e0b8964ee4e0f580eb61..bbb7e3d71242d485f3a1cc8a93ebc36b5b2f2e44 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp
@@ -21,7 +21,7 @@ namespace MantidQt
 {
   namespace CustomInterfaces
   {
-    DECLARE_SUBWINDOW(DirectConvertToEnergy);
+    DECLARE_SUBWINDOW(DirectConvertToEnergy)
   }
 }
 
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectBayes.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectBayes.cpp
index b1c8f32029d5c4e00ec093512dcf3f0e3f492bad..5b804a41d51346611690e28960ba8c15dab8bbc5 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectBayes.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectBayes.cpp
@@ -14,7 +14,7 @@ namespace MantidQt
 {
   namespace CustomInterfaces
   {
-    DECLARE_SUBWINDOW(IndirectBayes);
+    DECLARE_SUBWINDOW(IndirectBayes)
   }
 }
 
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataAnalysis.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataAnalysis.cpp
index fccc4b5d9b65ff6670c9fae894744f2560e148e6..c4e6b705319331cd2ab47f9fe87fb79ce65ec875 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataAnalysis.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataAnalysis.cpp
@@ -27,7 +27,7 @@ namespace CustomInterfaces
 namespace IDA
 {
   // Add this class to the list of specialised dialogs in this namespace
-  DECLARE_SUBWINDOW(IndirectDataAnalysis);
+  DECLARE_SUBWINDOW(IndirectDataAnalysis)
 
   /**
    * Constructor.
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataReduction.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataReduction.cpp
index f167fa71ea6ea714b4fdbb91813e32aa4c66bcd1..3bc7f982fb8738ef2db888419b97e1f06509c6c7 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataReduction.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataReduction.cpp
@@ -29,7 +29,7 @@ namespace MantidQt
 {
   namespace CustomInterfaces
   {
-    DECLARE_SUBWINDOW(IndirectDataReduction);
+    DECLARE_SUBWINDOW(IndirectDataReduction)
   }
 }
 
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDiffractionReduction.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDiffractionReduction.cpp
index ec4de290209dffb88b4e6be4939c98af143baa28..9516a1d50162596e62d2b2cf206f41d93fd02377 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDiffractionReduction.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDiffractionReduction.cpp
@@ -33,7 +33,7 @@ namespace // anon
   }
 } // anon namespace
 
-DECLARE_SUBWINDOW(IndirectDiffractionReduction);
+DECLARE_SUBWINDOW(IndirectDiffractionReduction)
 
 using namespace Mantid::API;
 using namespace MantidQt::CustomInterfaces;
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectSimulation.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectSimulation.cpp
index d0e38f7b34a0a8b34d47a19bfb904715e7bf6cd0..79454dfac0308058917c5f2ee0a935292af33a31 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectSimulation.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectSimulation.cpp
@@ -14,7 +14,7 @@ namespace MantidQt
 {
   namespace CustomInterfaces
   {
-    DECLARE_SUBWINDOW(IndirectSimulation);
+    DECLARE_SUBWINDOW(IndirectSimulation)
   }
 }
 
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectTools.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectTools.cpp
index f1f20f03fe2e7f9330d3e8b49e64e11bc5ace019..12d5730862cb9175e31470ae701d84ba7f1e0f87 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectTools.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectTools.cpp
@@ -13,7 +13,7 @@ namespace MantidQt
 {
   namespace CustomInterfaces
   {
-    DECLARE_SUBWINDOW(IndirectTools);
+    DECLARE_SUBWINDOW(IndirectTools)
   }
 }
 
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEV.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEV.cpp
index 12e730113c93f845e337af4abc2c69cff1ad69de..5ac92097495116849472d24de678d91822f465b9 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEV.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEV.cpp
@@ -4,6 +4,7 @@
 #include <QSettings>
 #include <QDesktopServices>
 #include <QDesktopWidget>
+#include <Poco/Path.h>
 
 #include "MantidQtCustomInterfaces/MantidEV.h"
 #include "MantidAPI/AlgorithmManager.h"
@@ -16,7 +17,7 @@ namespace CustomInterfaces
 {
 
 //Register the class with the factory
-DECLARE_SUBWINDOW(MantidEV);
+DECLARE_SUBWINDOW(MantidEV)
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -319,6 +320,12 @@ void MantidEV::initLayout()
    QObject::connect( m_uiForm.actionLoad_Isaw_Peaks, SIGNAL(triggered()),
                      this, SLOT(loadIsawPeaks_slot()) );
 
+   QObject::connect( m_uiForm.actionSave_Nexus_Peaks, SIGNAL(triggered()),
+                     this, SLOT(saveNexusPeaks_slot()) );
+
+   QObject::connect( m_uiForm.actionLoad_Nexus_Peaks, SIGNAL(triggered()),
+                     this, SLOT(loadNexusPeaks_slot()) );
+
    QObject::connect( m_uiForm.actionShow_UB, SIGNAL(triggered()),
                      this, SLOT(showUB_slot()) );
    
@@ -765,15 +772,22 @@ void MantidEV::findPeaks_slot()
    else if ( load_peaks )
    {
      std::string file_name = m_uiForm.SelectPeaksFile_ledt->text().trimmed().toStdString();
+     std::string extension = Poco::Path(file_name).getExtension();
      if ( file_name.length() == 0 )
      {
        errorMessage("Specify a peaks file with the peaks to be loaded.");
        return;
      }
- 
-     if ( !worker->loadIsawPeaks( peaks_ws_name, file_name ) )
-     {
-       errorMessage("Could not load requested peaks file");
+     if (extension.compare("nxs") == 0 || extension.compare("h5") == 0){
+       if ( !worker->loadNexusPeaks( peaks_ws_name, file_name ) ){
+         errorMessage("Could not load requested peaks file");
+       }
+     }
+     else {
+       if ( !worker->loadIsawPeaks( peaks_ws_name, file_name ) )
+       {
+         errorMessage("Could not load requested NeXus file");
+       }
      }
    }
 }
@@ -788,7 +802,7 @@ void MantidEV::getLoadPeaksFileName_slot()
   QString Qfile_name = QFileDialog::getOpenFileName( this,
                          tr("Load peaks file"),
                          file_path,
-                         tr("Peaks Files (*.peaks *.integrate);; All files(*.*)"));
+                         tr("Peaks Files (*.peaks *.integrate *.nxs *.h5);; All files(*.*)"));
 
   if ( Qfile_name.length()> 0 )
   {
@@ -808,7 +822,7 @@ void MantidEV::getSavePeaksFileName()
   QString Qfile_name = QFileDialog::getSaveFileName( this,
                           tr("Save peaks file"),
                           file_path,
-                          tr("Peaks Files (*.peaks *.integrate);; All files(*.*) "),
+                          tr("Peaks Files (*.peaks *.integrate *.nxs *.h5);; All files(*.*)"),
                           0, QFileDialog::DontConfirmOverwrite );
 
   if ( Qfile_name.length() > 0 )
@@ -1495,6 +1509,67 @@ void MantidEV::saveIsawPeaks_slot()
   }
 }
 
+/**
+ *  Slot called when the Save Nexus Peaks action is selected from the File menu.
+ */
+void MantidEV::saveNexusPeaks_slot()
+{
+  std::string peaks_ws_name  = m_uiForm.PeaksWorkspace_ledt->text().trimmed().toStdString();
+  if ( peaks_ws_name.length() == 0 )
+  {
+    errorMessage("Specify a peaks workspace name on the Find Peaks tab.");
+    return;
+  }
+
+  getSavePeaksFileName();
+
+  std::string file_name = m_uiForm.SelectPeaksFile_ledt->text().trimmed().toStdString();
+  if ( file_name.length() == 0 )
+  {
+     errorMessage("Specify a peaks file name for saving the peaks workspace.");
+     return;
+  }
+  else
+  {
+                              // if the file exists, check for overwrite or append
+    bool append = false;
+    QFile peaks_file( QString::fromStdString( file_name ) );
+    if ( peaks_file.exists() )
+    {
+      QMessageBox message_box( this->window() );
+      message_box.setText( tr("File Exists") );
+      message_box.setInformativeText("Replace file, or append peaks to file?");
+      QAbstractButton *replace_btn = message_box.addButton( tr("Replace"), QMessageBox::NoRole );
+      QAbstractButton *append_btn  = message_box.addButton( tr("Append"),  QMessageBox::YesRole );
+      message_box.setIcon( QMessageBox::Question );
+                                                   // it should not be necessary to do the next
+                                                   // four lines, but without them the message box
+                                                   // appears at random locations on RHEL 6
+      message_box.show();
+      QSize box_size = message_box.sizeHint();
+      QRect screen_rect = QDesktopWidget().screen()->rect();
+      message_box.move( QPoint( screen_rect.width()/2 - box_size.width()/2,
+                                screen_rect.height()/2 - box_size.height()/2 ) );
+      message_box.exec();
+
+      if ( message_box.clickedButton() == append_btn )
+      {
+        append = true;
+      }
+      else if ( message_box.clickedButton() == replace_btn )  // no strictly needed, but clearer
+      {
+        append = false;
+      }
+    }
+
+    if ( !worker->saveNexusPeaks( peaks_ws_name, file_name, append ) )
+    {
+      errorMessage( "Failed to save peaks to file" );
+      return;
+    }
+  }
+}
+
 
 /**
  *  Slot called when the Load Isaw Peaks action is selected from the File menu.
@@ -1526,6 +1601,36 @@ void MantidEV::loadIsawPeaks_slot()
   }
 }
 
+/**
+ *  Slot called when the Load Nexus Peaks action is selected from the File menu.
+ */
+void MantidEV::loadNexusPeaks_slot()
+{
+  std::string peaks_ws_name  = m_uiForm.PeaksWorkspace_ledt->text().trimmed().toStdString();
+  if ( peaks_ws_name.length() == 0 )
+  {
+    errorMessage("Specify a peaks workspace name on the Find Peaks tab.");
+    return;
+  }
+
+  getLoadPeaksFileName_slot();
+
+  std::string file_name = m_uiForm.SelectPeaksFile_ledt->text().trimmed().toStdString();
+  if ( file_name.length() == 0 )
+  {
+     errorMessage("Select a peaks file to be loaded.");
+     return;
+  }
+  else
+  {
+    if ( !worker->loadNexusPeaks( peaks_ws_name, file_name ) )
+    {
+      errorMessage( "Failed to Load Peaks File" );
+      return;
+    }
+  }
+}
+
 
 /**
  *  Slot called when the Show UB action is selected from the View menu.
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEVWorker.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEVWorker.cpp
index 0cba832b97f19448f1f25cf4cb021a12722ce7c8..6200f7641430ba30e3eef5835c6b14bfe9f1e36e 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEVWorker.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEVWorker.cpp
@@ -397,9 +397,31 @@ bool MantidEVWorker::loadIsawPeaks( const std::string & peaks_ws_name,
   return false;
 }
 
+/**
+ *  Load the specified peaks workspace from the specified NeXus file.
+ *
+ *  @param peaks_ws_name   The name of the peaks workspace to load/create.
+ *  @param file_name       The name of the NeXus file to load.
+ *
+ *  @return true if LoadNexusPeaks completed successfully.
+ */
+bool MantidEVWorker::loadNexusPeaks( const std::string & peaks_ws_name,
+                                    const std::string & file_name )
+{
+
+  IAlgorithm_sptr alg = AlgorithmManager::Instance().create("Load");
+  alg->setProperty("Filename",file_name );
+
+  alg->setProperty("OutputWorkspace", peaks_ws_name );
+
+  if ( alg->execute() )
+    return true;
+
+  return false;
+}
 
 /**
- *  Load the specified peaks workspace to the specified peaks file.
+ *  Save the specified peaks workspace to the specified peaks file.
  *
  *  @param peaks_ws_name   The name of the peaks workspace to save.
  *  @param file_name       The name of the peaks file to write to.
@@ -425,6 +447,43 @@ bool MantidEVWorker::saveIsawPeaks( const std::string & peaks_ws_name,
   return false;
 }
 
+/**
+ *  Save the specified peaks workspace to the specified peaks file.
+ *
+ *  @param peaks_ws_name   The name of the peaks workspace to save.
+ *  @param file_name       The name of the NeXus file to write to.
+ *
+ *  @return true if SaveNexusPeaks completed successfully.
+ */
+bool MantidEVWorker::saveNexusPeaks( const std::string & peaks_ws_name,
+                                    const std::string & file_name,
+                                    bool          append )
+{
+  if (append){
+    std::string temp_peaks_ws_name = "__MantidEVWorker_peaks_ws";
+    IAlgorithm_sptr load = AlgorithmManager::Instance().create("Load");
+    load->setProperty("OutputWorkspace", temp_peaks_ws_name );
+    load->setProperty("Filename",file_name );
+
+    load->execute();
+
+    IAlgorithm_sptr combine = AlgorithmManager::Instance().create("CombinePeaksWorkspaces");
+    combine->setProperty("LHSWorkspace", temp_peaks_ws_name );
+    combine->setProperty("RHSWorkspace", peaks_ws_name );
+    combine->setProperty("OutputWorkspace", peaks_ws_name );
+
+    combine->execute();
+  }
+  IAlgorithm_sptr alg = AlgorithmManager::Instance().create("SaveNexus");
+  alg->setProperty("InputWorkspace", peaks_ws_name );
+  alg->setProperty("Filename",file_name );
+
+  if ( alg->execute() )
+    return true;
+
+  return false;
+}
+
 
 /**
  *  Find an optimized UB matrix that indexes the peaks in the specified
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MultiDatasetFit.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MultiDatasetFit.cpp
index d2f78f8aea274891da734f5bd26faace46366734..096dd495cc22e961564d3e4aa4aed52ddea52010 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/MultiDatasetFit.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MultiDatasetFit.cpp
@@ -701,7 +701,7 @@ void EditLocalParameterDialog::valueChanged(int row, int col)
 /*==========================================================================================*/
 
 //Register the class with the factory
-DECLARE_SUBWINDOW(MultiDatasetFit);
+DECLARE_SUBWINDOW(MultiDatasetFit)
 
 /**
  * Constructor
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingView.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingView.cpp
index 4c285e12dfc91e8a8de065e898c3757e13095beb..136de6465559dbb12334db32d3f0c59af23b1c4b 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingView.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingView.cpp
@@ -3,6 +3,7 @@
 #include "MantidAPI/FunctionFactory.h"
 #include "MantidAPI/FunctionDomain1D.h"
 #include "MantidAPI/AlgorithmManager.h"
+#include "MantidQtAPI/HelpWindow.h"
 
 #include <boost/scoped_array.hpp>
 
@@ -63,6 +64,8 @@ namespace CustomInterfaces
     connect(m_ui.sections, SIGNAL(cellChanged(int,int)), SIGNAL(sectionRowModified(int)));
 
     connect(m_selectorModifiedMapper, SIGNAL(mapped(int)), SIGNAL(sectionSelectorModified(int)));
+
+    connect(m_ui.help, SIGNAL(clicked()), this, SLOT(help()));
   }
 
   QString ALCBaselineModellingView::function() const
@@ -201,5 +204,9 @@ namespace CustomInterfaces
     selector->setMaximum(values.second);
   }
 
+  void ALCBaselineModellingView::help() {
+    MantidQt::API::HelpWindow::showCustomInterface(NULL, QString("Muon_ALC"));
+  }
+
 } // namespace CustomInterfaces
 } // namespace MantidQt
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingPresenter.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingPresenter.cpp
index c92356a85561c25da2d4c5ff05080aa93feb9499..1e42a20b0d5a59e29a08c47d4a832bb993333f5f 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingPresenter.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingPresenter.cpp
@@ -137,6 +137,7 @@ namespace CustomInterfaces
     {
       m_view->setAvailableLogs(std::vector<std::string>()); // Empty logs list
       m_view->setAvailablePeriods(std::vector<std::string>()); // Empty period list
+      m_view->setTimeLimits(0,0); // "Empty" time limits
       return;
     }
 
@@ -161,6 +162,11 @@ namespace CustomInterfaces
       periods.push_back(buffer.str());
     }
     m_view->setAvailablePeriods(periods);
+
+    // Set time limits
+    m_view->setTimeLimits(ws->readX(0).front(),ws->readX(0).back());
+    // Set allowed time range
+    m_view->setTimeRange (ws->readX(0).front(),ws->readX(0).back());
   }
 
 } // namespace CustomInterfaces
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp
index 5f47cc6379331e13a2bc25d8ce08b743a5519ae4..6cea3759e0f926c01a1289b7d673dd3100963327 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp
@@ -1,5 +1,7 @@
 #include "MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h"
 
+#include "MantidQtAPI/HelpWindow.h"
+
 #include <QMessageBox>
 
 #include <qwt_symbol.h>
@@ -18,6 +20,8 @@ namespace CustomInterfaces
     connect(m_ui.load, SIGNAL(clicked()), SIGNAL(loadRequested()));
     connect(m_ui.firstRun, SIGNAL(fileFindingFinished()), SIGNAL(firstRunSelected()));
 
+    connect(m_ui.help, SIGNAL(clicked()), this, SLOT(help()));
+
     m_ui.dataPlot->setCanvasBackground(Qt::white);
     m_ui.dataPlot->setAxisFont(QwtPlot::xBottom, m_widget->font());
     m_ui.dataPlot->setAxisFont(QwtPlot::yLeft, m_widget->font());
@@ -159,6 +163,28 @@ namespace CustomInterfaces
     }
   }
 
+  void ALCDataLoadingView::setTimeLimits(double tMin, double tMax)
+  {
+    // Set initial values
+    m_ui.minTime->setValue(tMin);
+    m_ui.maxTime->setValue(tMax);
+  }
+
+  void ALCDataLoadingView::setTimeRange(double tMin, double tMax)
+  {
+    // Set range for minTime
+    m_ui.minTime->setMinimum(tMin);
+    m_ui.minTime->setMaximum(tMax);
+    // Set range for maxTime
+    m_ui.maxTime->setMinimum(tMin);
+    m_ui.maxTime->setMaximum(tMax);
+  }
+
+  void ALCDataLoadingView::help()
+  {
+    MantidQt::API::HelpWindow::showCustomInterface(NULL, QString("Muon_ALC"));
+  }
+
   void ALCDataLoadingView::setWaitingCursor()
   {
     QApplication::setOverrideCursor(Qt::WaitCursor);
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCInterface.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCInterface.cpp
index cfcce6e7aaef299491d61ac6a85b5f2f25b14f71..4de693e73db68b5a1563337d426d0c040a396f37 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCInterface.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCInterface.cpp
@@ -15,7 +15,7 @@ namespace MantidQt
 {
 namespace CustomInterfaces
 {
-  DECLARE_SUBWINDOW(ALCInterface);
+  DECLARE_SUBWINDOW(ALCInterface)
 
   const QStringList ALCInterface::STEP_NAMES =
       QStringList() << "Data loading" << "Baseline modelling" << "Peak fitting";
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingView.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingView.cpp
index 99c3f9ca4815814572a2e471d720fdf484f25ce6..d8183fe40bf20cce35c5a291c4c6d091cfea6cd6 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingView.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingView.cpp
@@ -1,5 +1,7 @@
 #include "MantidQtCustomInterfaces/Muon/ALCPeakFittingView.h"
 
+#include "MantidQtAPI/HelpWindow.h"
+
 #include <qwt_symbol.h>
 
 namespace MantidQt
@@ -54,6 +56,8 @@ void ALCPeakFittingView::initialize()
   connect(m_ui.peaks, SIGNAL(currentFunctionChanged()), SIGNAL(currentFunctionChanged()));
   connect(m_ui.peaks, SIGNAL(parameterChanged(QString,QString)),
           SIGNAL(parameterChanged(QString,QString)));
+
+  connect(m_ui.help, SIGNAL(clicked()), this, SLOT(help()));
 }
 
 void ALCPeakFittingView::setDataCurve(const QwtData& data)
@@ -100,6 +104,11 @@ void ALCPeakFittingView::setPeakPicker(const IPeakFunction_const_sptr& peak)
   m_ui.plot->replot();
 }
 
+void ALCPeakFittingView::help()
+{
+  MantidQt::API::HelpWindow::showCustomInterface(NULL, QString("Muon_ALC"));
+}
+
 } // namespace CustomInterfaces
 } // namespace Mantid
 
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp
index 2721c65258697ec121827a56a268a61e343d3184..cb0ee68ee1a4ae2db334523a394655418f9b1c32 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp
@@ -63,7 +63,7 @@ namespace MantidQt
 {
 namespace CustomInterfaces
 {
-  DECLARE_SUBWINDOW(MuonAnalysis);
+  DECLARE_SUBWINDOW(MuonAnalysis)
 
 using namespace Mantid::API;
 using namespace Mantid::Kernel;
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp
index 7882684398a58cd2c7b56a8589207ad780db5f78..11776a19d3524bc3b89477d470504c222530fce1 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp
@@ -14,7 +14,7 @@ namespace MantidQt
   {
     using namespace Mantid::API;
 
-    DECLARE_SUBWINDOW(QtReflMainView);
+    DECLARE_SUBWINDOW(QtReflMainView)
 
     //----------------------------------------------------------------------------------------------
     /** Constructor
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
index 1767acd57efd1dac3eb88703a2011890a6445ee8..c1be652ce1893086dde17f8be70bff29af6f2bf9 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
@@ -59,7 +59,7 @@ namespace MantidQt
 {
 namespace CustomInterfaces
 {
-  DECLARE_SUBWINDOW(SANSRunWindow);
+  DECLARE_SUBWINDOW(SANSRunWindow)
 
 
 using namespace MantidQt::MantidWidgets;
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/SampleTransmission.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/SampleTransmission.cpp
index c44be8a5c1cd9b77393efe04622e08e3c2b54826..6a95f432c7da1345f3a802eb4e3acd13ac4e67b7 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/SampleTransmission.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/SampleTransmission.cpp
@@ -19,7 +19,7 @@ namespace MantidQt
 {
 namespace CustomInterfaces
 {
-  DECLARE_SUBWINDOW(SampleTransmission);
+  DECLARE_SUBWINDOW(SampleTransmission)
 }
 }
 
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp
index 1281594d11f4654e9cd96fd8aeaed82e0bfc01ad..9b5df3cf3c275fdc4fe4cd28b84d9f92c3d07016 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp
@@ -21,7 +21,7 @@ namespace CustomInterfaces
 {
 
 //Register the class with the factory
-DECLARE_SUBWINDOW(StepScan);
+DECLARE_SUBWINDOW(StepScan)
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h
index 85159616f13a2f3cc86a4925e6f8873180a3c78d..f597c130acc03d277b07949bdd246fe917c017ec 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h
@@ -49,6 +49,8 @@ public:
   MOCK_METHOD3(updateSectionSelector, void(size_t, double, double));
 
   MOCK_METHOD1(displayError, void(const QString&));
+
+  MOCK_METHOD0(help, void());
 };
 
 class MockALCBaselineModellingModel : public IALCBaselineModellingModel
@@ -338,6 +340,12 @@ public:
 
     m_view->requestFit();
   }
+
+  void test_helpPage ()
+  {
+    EXPECT_CALL(*m_view, help()).Times(1);
+    m_view->help();
+  }
 };
 
 
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h
index 35b772c9c4bb6fa638b811cc7d27684c970a1057..e61879312c74af0428c2825ca5acd6ba8308326c 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h
@@ -48,8 +48,11 @@ public:
   MOCK_METHOD1(displayError, void(const std::string&));
   MOCK_METHOD1(setAvailableLogs, void(const std::vector<std::string>&));
   MOCK_METHOD1(setAvailablePeriods, void(const std::vector<std::string>&));
+  MOCK_METHOD2(setTimeLimits, void(double,double));
+  MOCK_METHOD2(setTimeRange, void(double,double));
   MOCK_METHOD0(setWaitingCursor, void());
   MOCK_METHOD0(restoreCursor, void());
+  MOCK_METHOD0(help, void());
 
   void requestLoading() { emit loadRequested(); }
   void selectFirstRun() { emit firstRunSelected(); }
@@ -260,6 +263,12 @@ public:
                            QwtDataY(2, 0.038717, 1E-6))));
     m_view->requestLoading();
   }
+
+  void test_helpPage ()
+  {
+    EXPECT_CALL(*m_view, help()).Times(1);
+    m_view->help();
+  }
 };
 
 
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCPeakFittingPresenterTest.h b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCPeakFittingPresenterTest.h
index 192811e0ab1502ca2c7f78c14a22c9c62f7fa336..36b8851b2caf33b3371c1e855787d6afe2417340 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCPeakFittingPresenterTest.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCPeakFittingPresenterTest.h
@@ -50,6 +50,7 @@ public:
   MOCK_METHOD1(setPeakPicker, void(const IPeakFunction_const_sptr&));
   MOCK_METHOD1(setFunction, void(const IFunction_const_sptr&));
   MOCK_METHOD3(setParameter, void(const QString&, const QString&, double));
+  MOCK_METHOD0(help, void());
 };
 
 class MockALCPeakFittingModel : public IALCPeakFittingModel
@@ -258,6 +259,12 @@ public:
 
     m_view->changeParameter(QString("f1"), QString("A0"));
   }
+
+  void test_helpPage ()
+  {
+    EXPECT_CALL(*m_view, help()).Times(1);
+    m_view->help();
+  }
 };
 
 
diff --git a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MessageDisplay.h b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MessageDisplay.h
index 5b5a1393bcb92a14c331b14694614fbb309b04df..11d940adb38fd2ad0ae43f9d9ff983fa584be371 100644
--- a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MessageDisplay.h
+++ b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MessageDisplay.h
@@ -41,7 +41,7 @@ namespace MantidQt
     class EXPORT_OPT_MANTIDQT_MANTIDWIDGETS MessageDisplay : public QWidget
     {
       Q_OBJECT
-      Q_PROPERTY(QString source READ source WRITE setSource);
+      Q_PROPERTY(QString source READ source WRITE setSource)
 
     public:
       /// Controls whether the display is allowed to set the log levels
@@ -106,7 +106,7 @@ namespace MantidQt
       void setGlobalLogLevel(int priority);
 
     private:
-      Q_DISABLE_COPY(MessageDisplay);
+      Q_DISABLE_COPY(MessageDisplay)
       /// Setup the actions
       void initActions();
       /// Initialize the text formats
diff --git a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/ScriptEditor.h b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/ScriptEditor.h
index db4b9699f40ad2a60784a5fd150877212a23173f..357f91374e038b9e1d2733a6549e161b1376583f 100644
--- a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/ScriptEditor.h
+++ b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/ScriptEditor.h
@@ -81,7 +81,7 @@ private:
 class EXPORT_OPT_MANTIDQT_MANTIDWIDGETS ScriptEditor : public QsciScintilla
 {
   // Qt macro
-  Q_OBJECT;
+  Q_OBJECT
 
 public:
   /**
diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp
index 88b8e682820ea1c0f96308cafe7e5e27a5023e12..2d239741f84dedb88b01c8f8884f92e94974da74 100644
--- a/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp
+++ b/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp
@@ -5,7 +5,6 @@
 
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/AlgorithmManager.h"
-#include "MantidQtAPI/QwtWorkspaceSpectrumData.h"
 
 #include <Poco/Notification.h>
 #include <Poco/NotificationCenter.h>
@@ -17,6 +16,8 @@
 #include <QPalette>
 #include <QVBoxLayout>
 
+#include <qwt_array.h>
+#include <qwt_data.h>
 #include <qwt_scale_engine.h>
 
 using namespace MantidQt::MantidWidgets;
@@ -25,6 +26,7 @@ using namespace Mantid::API;
 namespace
 {
   Mantid::Kernel::Logger g_log("PreviewPlot");
+  bool isNegative(double v) { return v <= 0.0; }
 }
 
 
@@ -328,9 +330,10 @@ bool PreviewPlot::hasCurve(const QString & curveName)
 
 
 /**
- * Attaches a RangeSelector to the plot and stores it.
+ * Creates a RangeSelector, adds it to the plot and stores it.
  *
  * @param rsName Name of range selector
+ * @param type Type of range selector to add
  * @return RangeSelector object
  */
 RangeSelector * PreviewPlot::addRangeSelector(const QString & rsName,
@@ -595,11 +598,31 @@ QwtPlotCurve * PreviewPlot::addCurve(MatrixWorkspace_sptr ws, const size_t specI
     ws = convertXAlg->getProperty("OutputWorkspace");
   }
 
-  // Create the plot data
-  QwtWorkspaceSpectrumData wsData(*ws, static_cast<int>(specIndex), false, false);
+  std::vector<double> wsDataY = ws->readY(specIndex);
+
+  // If using log scale need to remove all negative Y values
+  bool logYScale = getAxisType(QwtPlot::yLeft) == "Logarithmic";
+  if(logYScale)
+  {
+    // Remove negative data in order to search for minimum positive value
+    std::vector<double> validData(wsDataY.size());
+    auto it = std::remove_copy_if(wsDataY.begin(), wsDataY.end(), validData.begin(), isNegative);
+    validData.resize(std::distance(validData.begin(), it));
+
+    // Get minimum positive value
+    double minY = *std::min_element(validData.begin(), validData.end());
+
+    // Set all negative values to minimum positive value
+    std::replace_if(wsDataY.begin(), wsDataY.end(), isNegative, minY);
+  }
+
+  // Create the Qwt data
+  QwtArray<double> dataX = QVector<double>::fromStdVector(ws->readX(specIndex));
+  QwtArray<double> dataY = QVector<double>::fromStdVector(wsDataY);
+  QwtArrayData wsData(dataX, dataY);
 
   // Create the new curve
-  QwtPlotCurve *curve = new QwtPlotCurve();
+  QwtPlotCurve * curve = new QwtPlotCurve();
   curve->setData(wsData);
   curve->setPen(curveColour);
   curve->attach(m_uiForm.plot);
diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/SlicingAlgorithmDialog.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/SlicingAlgorithmDialog.cpp
index e6d8d87c6c1c37ee8484e845ba9cc91fb9ad052f..61a4e257246bafb4a8b61222f6f709c85e87ca92 100644
--- a/Code/Mantid/MantidQt/MantidWidgets/src/SlicingAlgorithmDialog.cpp
+++ b/Code/Mantid/MantidQt/MantidWidgets/src/SlicingAlgorithmDialog.cpp
@@ -16,8 +16,8 @@ namespace MantidQt
 {
   namespace MantidWidgets
   {
-    DECLARE_DIALOG(SliceMDDialog);
-    DECLARE_DIALOG(BinMDDialog);
+    DECLARE_DIALOG(SliceMDDialog)
+    DECLARE_DIALOG(BinMDDialog)
 
     /**
     Constructor
diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/pqHelpWindow.cxx b/Code/Mantid/MantidQt/MantidWidgets/src/pqHelpWindow.cxx
index d1254e69fec2fa11108818d17da4150c03dd66fe..82bb4d84743c31afd9166d4a5a00469f8e949c6b 100644
--- a/Code/Mantid/MantidQt/MantidWidgets/src/pqHelpWindow.cxx
+++ b/Code/Mantid/MantidQt/MantidWidgets/src/pqHelpWindow.cxx
@@ -170,7 +170,7 @@ protected:
   }
 
 private:
-  Q_DISABLE_COPY(pqNetworkAccessManager);
+  Q_DISABLE_COPY(pqNetworkAccessManager)
 };
 
 // ****************************************************************************
diff --git a/Code/Mantid/MantidQt/Python/CMakeLists.txt b/Code/Mantid/MantidQt/Python/CMakeLists.txt
index 0624231af29b862ae944506786baf9f0deee4902..92a7f22f8f992ec7b5177a0d6c92fbc48b0afc6d 100644
--- a/Code/Mantid/MantidQt/Python/CMakeLists.txt
+++ b/Code/Mantid/MantidQt/Python/CMakeLists.txt
@@ -49,7 +49,7 @@ add_custom_command ( OUTPUT ${SIP_SRC}
 )                     
 
 # Needed for sip.h header that can end up in a different place to to the main Python include directory
-include_directories ( ${SIP_INCLUDE_DIR} )
+include_directories ( SYSTEM ${SIP_INCLUDE_DIR} )
 
 # Needed for sip generated files to find includes in src
 include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} )
diff --git a/Code/Mantid/MantidQt/Python/mantidqt.sip b/Code/Mantid/MantidQt/Python/mantidqt.sip
index a4f514df9c8a9d020475ae54d72bdbdb5cdf156e..89b157802ef4eb028147b0af50470e9ab5506ac7 100644
--- a/Code/Mantid/MantidQt/Python/mantidqt.sip
+++ b/Code/Mantid/MantidQt/Python/mantidqt.sip
@@ -10,6 +10,12 @@
 // Define the module name. This has to match the library filename
 %Module mantidqtpython
 
+%UnitCode
+  #if defined(__GNUC__) && !(defined(__INTEL_COMPILER))
+    #pragma GCC system_header
+  #endif
+%End
+
 /******************************** SIP Imports ****************/
 %Import QtCore/QtCoremod.sip
 %Import QtGui/QtGuimod.sip
diff --git a/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in b/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in
index 6e64f1e2b3da4717fee67b9fdff519fba0d76517..c72a0a422afcb44d08b6b03ba779d2fab03d0fa7 100644
--- a/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in
+++ b/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in
@@ -1,13 +1,7 @@
-//------------------------------------------------------------------------------
-// A wrapper for the auto-generated sip*.cpp files to disable warnings
-// that we can't control
-//------------------------------------------------------------------------------
-#if defined(__GNUC__) && !(defined(__INTEL_COMPILER))
-  #pragma GCC diagnostic ignored "-Wuninitialized"
-  #pragma GCC diagnostic ignored "-Wconversion"
-  #pragma GCC diagnostic ignored "-Wunused-variable"
-  #pragma GCC diagnostic ignored "-Wparentheses"
-  #pragma GCC diagnostic ignored "-Wcast-qual"
-#endif
-
+//--------------------------------------------------------------------------------------
+// A wrapper for the auto-generated sipmantidqtpythonpart?.cpp files to disable warnings
+// that we can't control. The warnings are actually suppressed in qti.sip
+// with '#pragma GCC system_header' but that pragma only works if it occurs
+// in a file that has been included with '#include'
+//-------------------------------------------------------------------------------------
 #include "sipmantidqtpythonpart0.cpp"
diff --git a/Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/PeakOverlayViewFactorySelector.h b/Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/PeakOverlayViewFactorySelector.h
index bdd50ce73d422544a5f013e406419d1dac0de2fe..e4b413e2f8a9c343dc0d3c8be11154db5bbf9fd6 100644
--- a/Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/PeakOverlayViewFactorySelector.h
+++ b/Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/PeakOverlayViewFactorySelector.h
@@ -21,7 +21,7 @@ namespace MantidQt
     private:
       typedef std::set<PeakOverlayViewFactory_sptr> PeakOverlayViewFactorySet;
       PeakOverlayViewFactorySet m_candidates;
-      DISABLE_COPY_AND_ASSIGN(PeakOverlayViewFactorySelector);
+      DISABLE_COPY_AND_ASSIGN(PeakOverlayViewFactorySelector)
     public:
       PeakOverlayViewFactorySelector();
       ~PeakOverlayViewFactorySelector();
diff --git a/Code/Mantid/Testing/Data/DocTest/PawleySilicon.nxs.md5 b/Code/Mantid/Testing/Data/DocTest/PawleySilicon.nxs.md5
new file mode 100644
index 0000000000000000000000000000000000000000..dfb0fc386fc0b27d0792f7fdcc48840d77941bd6
--- /dev/null
+++ b/Code/Mantid/Testing/Data/DocTest/PawleySilicon.nxs.md5
@@ -0,0 +1 @@
+f814c587c2dbe2df89b153f1ad95d4f6
diff --git a/Code/Mantid/Testing/Data/DocTest/PoldiCrystalFileExample.dat.md5 b/Code/Mantid/Testing/Data/DocTest/PoldiCrystalFileExample.dat.md5
new file mode 100644
index 0000000000000000000000000000000000000000..fb77808522c795bde838bad1aba33b5ddb7f8afb
--- /dev/null
+++ b/Code/Mantid/Testing/Data/DocTest/PoldiCrystalFileExample.dat.md5
@@ -0,0 +1 @@
+0a93f7213e39cf02f7cb7ddb27f4d6f9
diff --git a/Code/Mantid/Testing/Data/DocTest/irs26176_graphite002_cyl_Abs.nxs.md5 b/Code/Mantid/Testing/Data/DocTest/irs26176_graphite002_cyl_Abs.nxs.md5
new file mode 100644
index 0000000000000000000000000000000000000000..98a9172ca63dedcff46b07b47068f93ff1951a2b
--- /dev/null
+++ b/Code/Mantid/Testing/Data/DocTest/irs26176_graphite002_cyl_Abs.nxs.md5
@@ -0,0 +1 @@
+f4b31e993d1747f22074cd17365cf0eb
\ No newline at end of file
diff --git a/Code/Mantid/Testing/Data/UnitTest/dn134011vana.d_dat.md5 b/Code/Mantid/Testing/Data/UnitTest/dn134011vana.d_dat.md5
new file mode 100644
index 0000000000000000000000000000000000000000..e99469630d6e0dcdb7a224f83817cb20eb2d2a24
--- /dev/null
+++ b/Code/Mantid/Testing/Data/UnitTest/dn134011vana.d_dat.md5
@@ -0,0 +1 @@
+28151e3198f9f57b18b97d87627eadf6
diff --git a/Code/Mantid/Testing/Data/UnitTest/irs26176_graphite002_cyl_Abs.nxs.md5 b/Code/Mantid/Testing/Data/UnitTest/irs26176_graphite002_cyl_Abs.nxs.md5
new file mode 100644
index 0000000000000000000000000000000000000000..98a9172ca63dedcff46b07b47068f93ff1951a2b
--- /dev/null
+++ b/Code/Mantid/Testing/Data/UnitTest/irs26176_graphite002_cyl_Abs.nxs.md5
@@ -0,0 +1 @@
+f4b31e993d1747f22074cd17365cf0eb
\ No newline at end of file
diff --git a/Code/Mantid/Testing/SystemTests/tests/analysis/CodeConventions.py b/Code/Mantid/Testing/SystemTests/tests/analysis/CodeConventions.py
index ceb618874de196fe64eb1c4b9a26fd5a50983f53..b87cc677be768a642d06adbc26f83ca5e8405fba 100644
--- a/Code/Mantid/Testing/SystemTests/tests/analysis/CodeConventions.py
+++ b/Code/Mantid/Testing/SystemTests/tests/analysis/CodeConventions.py
@@ -53,7 +53,9 @@ FUNC_BAD_PARAMS = {
                       "f0_Xoffset", "f0_Yoffset", "f0_Zoffset",
                       "f0_Xrot", "f0_Yrot", "f0_Zrot",
                       "l0", "t0"),
-    "StretchedExpFT":("height", "tau", "beta")
+    "StretchedExpFT":("height", "tau", "beta"),
+    "PawleyParameterFunction":("a","b","c"),
+    "PawleyFunction":("f0.a","f0.b","f0.c", "f0.Alpha", "f0.Beta", "f0.Gamma", "f0.ZeroShift"),
     }
 
 class Algorithms(stresstesting.MantidStressTest):
diff --git a/Code/Mantid/Testing/SystemTests/tests/analysis/ISISDirectReductionComponents.py b/Code/Mantid/Testing/SystemTests/tests/analysis/ISISDirectReductionComponents.py
index a7677cb70662eaf5ea25d44a2ce71d15b1064a23..1e556601d2e32ba363d7564ffeecaf87e2a3c8a8 100644
--- a/Code/Mantid/Testing/SystemTests/tests/analysis/ISISDirectReductionComponents.py
+++ b/Code/Mantid/Testing/SystemTests/tests/analysis/ISISDirectReductionComponents.py
@@ -136,6 +136,8 @@ class ISISLoadFilesRAW(stresstesting.MantidStressTest):
         self.assertTrue(isinstance(ws,Workspace))
         self.assertEqual(ws.getNumberHistograms(),41472)
         self.assertEqual(mon_ws.getNumberHistograms(),4)
+
+        
         #
         self.valid = True
 
@@ -180,26 +182,36 @@ class ISISLoadFilesMER(stresstesting.MantidStressTest):
         propman.sample_run = 18492 # (histogram nxs file )
         propman.det_cal_file = None
         mon_ws = PropertyManager.sample_run.get_monitors_ws()
+        self.assertTrue('SR_MER018492' in mtd)
         self.assertTrue(not mon_ws is None)
         ws = PropertyManager.sample_run.get_workspace()
         self.assertTrue(isinstance(ws,Workspace))
         self.assertEqual(ws.getNumberHistograms(),69641)
         self.assertEqual(mon_ws.getNumberHistograms(),69641)
+        self.assertEqual(mon_ws.getIndexFromSpectrumNumber(69638),69637)
+        det = mon_ws.getDetector(69632)
+        self.assertTrue(det.isMonitor())
+        det = mon_ws.getDetector(69631)
+        self.assertFalse(det.isMonitor())
 
 
-        self.valid = True
-        return
         #  enable when bug #10980 is fixed
+        propman.sample_run = None # delete all
+        self.assertFalse('SR_MER018492' in mtd)
         propman.sample_run = 18492 # (histogram nxs file )
+        propman.load_monitors_with_workspace = False
         propman.det_cal_file = None
         mon_ws = PropertyManager.sample_run.get_monitors_ws()
         self.assertTrue(not mon_ws is None)
+        self.assertTrue('SR_MER018492_monitors' in mtd)
 
         ws = PropertyManager.sample_run.get_workspace()
         self.assertTrue(isinstance(ws,Workspace))
         self.assertEqual(ws.getNumberHistograms(),69632)
         self.assertEqual(mon_ws.getNumberHistograms(),9)
-
+        self.assertEqual(mon_ws.getIndexFromSpectrumNumber(69633),0)
+        det = mon_ws.getDetector(0)
+        self.assertTrue(det.isMonitor())
 
         self.valid = True
 
diff --git a/Code/Mantid/Testing/SystemTests/tests/analysis/reference/LET14305_3_4meV2015.nxs.md5 b/Code/Mantid/Testing/SystemTests/tests/analysis/reference/LET14305_3_4meV2015.nxs.md5
index 6ed489c5d183269d37b381740d357b69880be926..db2816f3213cd365f848967e5fee8545639fb54b 100644
--- a/Code/Mantid/Testing/SystemTests/tests/analysis/reference/LET14305_3_4meV2015.nxs.md5
+++ b/Code/Mantid/Testing/SystemTests/tests/analysis/reference/LET14305_3_4meV2015.nxs.md5
@@ -1 +1 @@
-df968e07d52c10b9c3ecf4b2c5db596a
\ No newline at end of file
+6441be305fa8c6d32fe322786bafa26a
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/CMakeLists.txt
index c2820075f5b9546d8af25164e2a90a4356c9276c..a9f5477cb67e0e7ec322aa736f0b5dfc34fe0aeb 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/CMakeLists.txt
@@ -1,5 +1,5 @@
 PROJECT(PeaksFilter)
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 ADD_PARAVIEW_PLUGIN(MantidParaViewPeaksFilterSMPlugin "1.0"
 SERVER_MANAGER_XML PeaksFilter.xml
 SERVER_MANAGER_SOURCES vtkPeaksFilter.cxx
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/vtkPeaksFilter.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/vtkPeaksFilter.cxx
index fdf20fa28303c06777aa95d603caa228a2fe86c2..27c35049f11bf54af934caaf89ea9be38599ffe0 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/vtkPeaksFilter.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/vtkPeaksFilter.cxx
@@ -17,7 +17,7 @@
 #include <vtkUnstructuredGrid.h>
 #include <vtkFieldData.h>
 
-vtkStandardNewMacro(vtkPeaksFilter);
+vtkStandardNewMacro(vtkPeaksFilter)
 
 using namespace Mantid::VATES;
 
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/CMakeLists.txt
index 451c01cae863284680de52d19f792858dbce6778..056b2b05e3ab0277365d923b6b417f4ec79bce8d 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/CMakeLists.txt
@@ -1,5 +1,5 @@
 PROJECT(ScaleWorkspace)
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 ADD_PARAVIEW_PLUGIN(MantidParaViewScaleWorkspaceSMPlugin "1.0"
 SERVER_MANAGER_XML ScaleWorkspace.xml
 SERVER_MANAGER_SOURCES vtkScaleWorkspace.cxx
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/vtkScaleWorkspace.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/vtkScaleWorkspace.cxx
index a9eef434d14e69bd0b5fcc06b8478c280001e375..e9b15021d609133cb6f51eed9b88836e0b8f1f2e 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/vtkScaleWorkspace.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/vtkScaleWorkspace.cxx
@@ -11,7 +11,7 @@
 #include <vtkUnstructuredGridAlgorithm.h>
 #include <vtkUnstructuredGrid.h>
 
-vtkStandardNewMacro(vtkScaleWorkspace);
+vtkStandardNewMacro(vtkScaleWorkspace)
 
 using namespace Mantid::VATES;
 
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/CMakeLists.txt
index d6beddcd88c7ed717d09de75be6d9176ac6c631b..3d3208936b160accd33e8118ba8f07e952fc1774 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/CMakeLists.txt
@@ -1,5 +1,5 @@
 PROJECT(SplatterPlot)
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 ADD_PARAVIEW_PLUGIN(MantidParaViewSplatterPlotSMPlugin "1.0"
 	SERVER_MANAGER_XML SplatterPlot.xml
 	SERVER_MANAGER_SOURCES vtkSplatterPlot.cxx
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/vtkSplatterPlot.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/vtkSplatterPlot.cxx
index b2266585c5321043191545e8756e02c042dd8248..7a60a3852bef3d1482bc4c830864cd7eaeed2067 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/vtkSplatterPlot.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/vtkSplatterPlot.cxx
@@ -20,7 +20,7 @@
 using namespace Mantid::API;
 using namespace Mantid::VATES;
 
-vtkStandardNewMacro(vtkSplatterPlot);
+vtkStandardNewMacro(vtkSplatterPlot)
 
 /// Constructor
 vtkSplatterPlot::vtkSplatterPlot() : m_numberPoints(0), m_topPercentile(0.0),
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/CMakeLists.txt
index 798b29582c9ba409cc3678864887fd02df603ab4..5537e38b62060127c5fb4d58d948d546be8762f2 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/CMakeLists.txt
@@ -1,5 +1,5 @@
 project( MantidParaViewEventNexusReader )
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 add_paraview_plugin( MantidParaViewEventNexusReaderSMPlugin "1.0"
 	SERVER_MANAGER_XML EventNexusReader.xml
 	SERVER_MANAGER_SOURCES vtkEventNexusReader.cxx
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/vtkEventNexusReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/vtkEventNexusReader.cxx
index db709eb1240a81744f9e13d7a00c7cca69809f17..6edd4d02dad28f5390c1fa7bae58800858712a37 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/vtkEventNexusReader.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/vtkEventNexusReader.cxx
@@ -18,7 +18,7 @@
 #include "MantidVatesAPI/FilteringUpdateProgressAction.h"
 #include "MantidVatesAPI/MDLoadingViewAdapter.h"
 
-vtkStandardNewMacro(vtkEventNexusReader);
+vtkStandardNewMacro(vtkEventNexusReader)
 
 using namespace Mantid::VATES;
 using Mantid::Geometry::IMDDimension_sptr;
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/CMakeLists.txt
index aa1f3a57ed9cc71f134f260ae1041af0ec297790..c7b74fc70f15a434c697c3d51ff59cb360cd2352 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/CMakeLists.txt
@@ -1,5 +1,5 @@
 project( MantidParaViewMDEWNexusReader )
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 add_paraview_plugin( MantidParaViewMDEWNexusReaderSMPlugin "1.0"
 	SERVER_MANAGER_XML MDEWNexusReader.xml
 	SERVER_MANAGER_SOURCES vtkMDEWNexusReader.cxx
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/vtkMDEWNexusReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/vtkMDEWNexusReader.cxx
index 6cd9ab74d996765a44ca49bfc67c53c13d2e8513..880b277761c1022eef60995f53879fa5a5713ca4 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/vtkMDEWNexusReader.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/vtkMDEWNexusReader.cxx
@@ -21,7 +21,7 @@
 
 #include <QtDebug>
 
-vtkStandardNewMacro(vtkMDEWNexusReader);
+vtkStandardNewMacro(vtkMDEWNexusReader)
 
 using namespace Mantid::VATES;
 using Mantid::Geometry::IMDDimension_sptr;
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/CMakeLists.txt
index 6ad4b9ff3c8269fe750588f504933888e88ff74b..5607de2b63ea14c474d48f8e3e37633e3639cf5d 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/CMakeLists.txt
@@ -1,5 +1,5 @@
 project( MantidParaViewMDHWNexusReader )
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 add_paraview_plugin( MantidParaViewMDHWNexusReaderSMPlugin "1.0"
 	SERVER_MANAGER_XML MDHWNexusReader.xml
 	SERVER_MANAGER_SOURCES vtkMDHWNexusReader.cxx
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx
index 95f90f535cc83a342a0d2a09ad7ee5b7ab38389a..834965eb2c5cff7b5ce314d5c66311dabffc5e7a 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx
@@ -19,7 +19,7 @@
 #include "MantidVatesAPI/FilteringUpdateProgressAction.h"
 #include "MantidVatesAPI/MDLoadingViewAdapter.h"
 
-vtkStandardNewMacro(vtkMDHWNexusReader);
+vtkStandardNewMacro(vtkMDHWNexusReader)
 
 using namespace Mantid::VATES;
 using Mantid::Geometry::IMDDimension_sptr;
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/CMakeLists.txt
index 685637a59d6abfc82ba8482b37eed70e9a21a90f..9a1c7182a7630e7700bc088b25d8a8931d6bf545 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/CMakeLists.txt
@@ -1,5 +1,5 @@
 project( MantidParaViewNexusPeaksReader )
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 add_paraview_plugin( MantidParaViewNexusPeaksReaderSMPlugin "1.0"
 	SERVER_MANAGER_XML NexusPeaksReader.xml
 	SERVER_MANAGER_SOURCES vtkNexusPeaksReader.cxx
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/vtkNexusPeaksReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/vtkNexusPeaksReader.cxx
index d04f458bb6ed8791f5eb29b5d2244037b599bd09..7e228505d0867c284eb3bfa61c8fe381d01bbcad 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/vtkNexusPeaksReader.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/vtkNexusPeaksReader.cxx
@@ -23,7 +23,7 @@
 #include <nexus/NeXusException.hpp>
 #include <boost/algorithm/string.hpp>    
 
-vtkStandardNewMacro(vtkNexusPeaksReader);
+vtkStandardNewMacro(vtkNexusPeaksReader)
 
 using namespace Mantid::VATES;
 using Mantid::Geometry::IMDDimension_sptr;
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/CMakeLists.txt
index 0944ba06626700f9a4cc93f98b49c819d45a5930..3b2407ae805533e0fb505617a7278376b6c32144 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/CMakeLists.txt
@@ -1,5 +1,5 @@
 project( MantidParaViewPeaksReader )
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 add_paraview_plugin( MantidParaViewPeaksReaderSMPlugin "1.0"
 	SERVER_MANAGER_XML PeaksReader.xml
 	SERVER_MANAGER_SOURCES vtkPeaksReader.cxx
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/vtkPeaksReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/vtkPeaksReader.cxx
index a63fce33d42a2124a35b59f0e88f75f36fec9fa2..70a227c7af43491c669f37378ce6624c80fb58ab 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/vtkPeaksReader.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/vtkPeaksReader.cxx
@@ -22,7 +22,7 @@
 
 #include <boost/algorithm/string.hpp>    
 
-vtkStandardNewMacro(vtkPeaksReader);
+vtkStandardNewMacro(vtkPeaksReader)
 
 using namespace Mantid::VATES;
 using Mantid::Geometry::IMDDimension_sptr;
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/CMakeLists.txt
index eace77b7a09ba4f29f0c27cd5fe198ca1160181f..d8d8525c52cfdb3205ce7c7e1c0f3bbbfb1ceb33 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/CMakeLists.txt
@@ -1,5 +1,5 @@
 project( MantidParaViewSQWEventReader )
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 add_paraview_plugin( MantidParaViewSQWEventReaderSMPlugin "1.0"
 	SERVER_MANAGER_XML SQWEventReader.xml
 	SERVER_MANAGER_SOURCES vtkSQWEventReader.cxx
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/vtkSQWEventReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/vtkSQWEventReader.cxx
index d964c50c2d613f66fe9e4f17c8ea86ee59b43b1e..ef61e72c3cc659df3fb6115e1038ea11706e8c30 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/vtkSQWEventReader.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/vtkSQWEventReader.cxx
@@ -19,7 +19,7 @@
 #include "MantidVatesAPI/FilteringUpdateProgressAction.h"
 #include "MantidVatesAPI/MDLoadingViewAdapter.h"
 
-vtkStandardNewMacro(vtkSQWEventReader);
+vtkStandardNewMacro(vtkSQWEventReader)
 
 using namespace Mantid::VATES;
 using Mantid::Geometry::IMDDimension_sptr;
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWReader/CMakeLists.txt
index cf5dd9ef299fdd3b1b109c30e5e3f2989cf3ee8e..f061505754421f1dca0feb8e1ce7c90521963636 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWReader/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWReader/CMakeLists.txt
@@ -1,5 +1,5 @@
 project( MantidParaViewSQWReader )
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 add_paraview_plugin( MantidParaViewSQWReaderSMPlugin "1.0"
 	SERVER_MANAGER_XML SQWReader.xml
 	SERVER_MANAGER_SOURCES vtkSQWReader.cxx
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/CMakeLists.txt
index 1719a68e0bd612ab248b72fa83132a5cf204ac28..a40f403de2a1e94f1ea15d0c303023f40dab8c75 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/CMakeLists.txt
@@ -1,5 +1,5 @@
 PROJECT(MantidParaViewMDEWSource)
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 ADD_PARAVIEW_PLUGIN(MantidParaViewMDEWSourceSMPlugin "1.0"
 	SERVER_MANAGER_XML MDEWSource.xml
 	SERVER_MANAGER_SOURCES vtkMDEWSource.cxx)
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.cxx
index 12fc54a626e157a8dae75ade5443cd399ee3a8c9..196dd73e69c89ad37b7fcd5e524f70af033017e5 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.cxx
@@ -19,7 +19,7 @@
 
 using namespace Mantid::VATES;
 
-vtkStandardNewMacro(vtkMDEWSource);
+vtkStandardNewMacro(vtkMDEWSource)
 
 /// Constructor
 vtkMDEWSource::vtkMDEWSource() :  m_wsName(""), m_depth(1000), m_time(0), m_presenter(NULL), m_isStartup(true), m_startupTimeValue(0)
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/CMakeLists.txt
index d65a9066e679883bdcbb1b5c204d64293729f4e7..e3fa0dd9580eb5df2b4847d05680e77f8d7139f0 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/CMakeLists.txt
@@ -1,5 +1,5 @@
 PROJECT(MantidParaViewMDHWSource)
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 ADD_PARAVIEW_PLUGIN(MantidParaViewMDHWSourceSMPlugin "1.0"
 	SERVER_MANAGER_XML MDHWSource.xml
 	SERVER_MANAGER_SOURCES vtkMDHWSource.cxx)
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx
index 26ed4e7eba59c5dda0e41098d7c1e493341cdc8c..e2757e29cacbdf39746273ce58366e5dac853dd3 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx
@@ -19,7 +19,7 @@
 
 using namespace Mantid::VATES;
 
-vtkStandardNewMacro(vtkMDHWSource);
+vtkStandardNewMacro(vtkMDHWSource)
 
 /// Constructor
 vtkMDHWSource::vtkMDHWSource() :  m_wsName(""), m_time(0), m_presenter(NULL)
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/CMakeLists.txt
index bbf6ca2935239268a0d0efca8690f5da4edeb9c9..188fe0c7fafd56fd6fc564e474a51c551912f43f 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/CMakeLists.txt
@@ -1,5 +1,5 @@
 PROJECT(MantidParaViewPeaksSource)
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 ADD_PARAVIEW_PLUGIN(MantidParaViewPeaksSourceSMPlugin "1.0"
 	SERVER_MANAGER_XML PeaksSource.xml
 	SERVER_MANAGER_SOURCES vtkPeaksSource.cxx)
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.cxx
index 6709e928e1f7d89a664fcd38c5d23855e48532d3..e3ff1ab962be5ecd64eb83c51ebccf2f687db319 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.cxx
@@ -16,7 +16,7 @@
 #include "MantidAPI/AnalysisDataService.h"
 
 
-vtkStandardNewMacro(vtkPeaksSource);
+vtkStandardNewMacro(vtkPeaksSource)
 
 using namespace Mantid::VATES;
 using Mantid::Geometry::IMDDimension_sptr;
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/CMakeLists.txt
index f846a0c12d52d10efc6aa9a44a96867c1d0b0551..b713178fd46d2911ff18e3f270e4ca7cca838a7b 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/CMakeLists.txt
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/CMakeLists.txt
@@ -1,5 +1,5 @@
 PROJECT(MantidParaViewSinglePeakMarkerSource)
-
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
 ADD_PARAVIEW_PLUGIN(MantidParaViewSinglePeakMarkerSourceSMPlugin "1.0"
 	SERVER_MANAGER_XML SinglePeakMarkerSource.xml
 	SERVER_MANAGER_SOURCES vtkSinglePeakMarkerSource.cxx)
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/vtkSinglePeakMarkerSource.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/vtkSinglePeakMarkerSource.cxx
index e8da4f13ecdcf8869f319cf583371ae80f0a18db..d607310440f8b68c6fcdb0e63170f4530c0dddbc 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/vtkSinglePeakMarkerSource.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/vtkSinglePeakMarkerSource.cxx
@@ -6,7 +6,7 @@
 
 #include "MantidVatesAPI/vtkSinglePeakMarker.h"
 
-vtkStandardNewMacro(vtkSinglePeakMarkerSource);
+vtkStandardNewMacro(vtkSinglePeakMarkerSource)
 
 using namespace Mantid::VATES;
 
diff --git a/Code/Mantid/Vates/VatesAPI/src/LoadVTK.cpp b/Code/Mantid/Vates/VatesAPI/src/LoadVTK.cpp
index 31a7809f448cedc36ddb4ab43bf390986ce20952..a003d1569f72fb1ba7ef008ada705180e846474e 100644
--- a/Code/Mantid/Vates/VatesAPI/src/LoadVTK.cpp
+++ b/Code/Mantid/Vates/VatesAPI/src/LoadVTK.cpp
@@ -66,7 +66,7 @@ namespace Mantid
 {
   namespace VATES
   {
-    DECLARE_FILELOADER_ALGORITHM(LoadVTK);
+    DECLARE_FILELOADER_ALGORITHM(LoadVTK)
 
     /**
      * Return the confidence with with this algorithm can load the file
diff --git a/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt b/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt
index f2af04d6f4fd3c63c5c5347edca31def4f45d1b8..bcb80bf44f188c723e56314f298d862aaa9a404f 100644
--- a/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt
+++ b/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt
@@ -38,6 +38,8 @@ set( TEST_SUITES
 
 add_executable( ${PROJECT_NAME} ${INCLUDE_FILES} ${SOURCE_FILES} ${MOC_SRCS} )
 
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
+
 target_link_libraries( ${PROJECT_NAME}
 pqCore pqComponents pqApplicationComponents
 ${QT_LIBRARIES}
diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt
index 278a8015e40de9a2a2b631f9d86a845a854ea999..98fb3b2fe5843f2f5051296c6f2b5bd42cb2cf2e 100644
--- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt
+++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt
@@ -122,11 +122,14 @@ set_target_properties( VatesSimpleGuiViewWidgets PROPERTIES OUTPUT_NAME MantidVa
 # Add to the 'VatesSimpleGui' group in VS
 set_property( TARGET VatesSimpleGuiViewWidgets PROPERTY FOLDER MantidVatesSimpleGui )
 
+
+include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
+
 target_link_libraries( VatesSimpleGuiViewWidgets
-VatesSimpleGuiQtWidgets
 pqApplicationComponents
 pqComponents
 ${QT_LIBRARIES}
+VatesSimpleGuiQtWidgets
 MantidQtAPI
 VatesAPI
 ${MANTID_SUBPROJECT_LIBS}
diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/AutoScaleRangeGenerator.cpp b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/AutoScaleRangeGenerator.cpp
index b82e74ce8f4de0ea46f8052eb9ab006c0096139f..8bb04709ace7bf305902120620028907daefc127 100644
--- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/AutoScaleRangeGenerator.cpp
+++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/AutoScaleRangeGenerator.cpp
@@ -39,7 +39,7 @@ namespace SimpleGui
   {
     //Set the initial log scale state due to the mode
     m_mdSettings.setLastSessionLogScale(getLogScale());
-  };
+  }
 
   /**
    * Gets the log scale for the mode
diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/BackgroundRgbProvider.cpp b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/BackgroundRgbProvider.cpp
index 7cba3778ed2e1c915e2229ddaf411ea3a1274a5b..59b0757a017629cff5dc453b01656a09b1bf9f23 100644
--- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/BackgroundRgbProvider.cpp
+++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/BackgroundRgbProvider.cpp
@@ -29,13 +29,13 @@ namespace Mantid
 
       BackgroundRgbProvider::BackgroundRgbProvider()
       {
-      };
+      }
 
       BackgroundRgbProvider::~BackgroundRgbProvider()
       {
          // Need to record the background color
          update();
-      };
+      }
 
       std::vector<double> BackgroundRgbProvider::getRgb(bool viewSwitched)
       {
diff --git a/Code/Mantid/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst b/Code/Mantid/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst
new file mode 100644
index 0000000000000000000000000000000000000000..40af9ecafb8fd56c2fab386b2f1f30d917c01d21
--- /dev/null
+++ b/Code/Mantid/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst
@@ -0,0 +1,76 @@
+.. algorithm::
+
+.. summary::
+
+.. alias::
+
+.. properties::
+
+Description
+-----------
+
+Applies absorption corrections calculated in the Paalman & Pings absorption
+factor format: :math:`A_{s,s}` (correction factor for scattering and absorption
+in sample), :math:`A_{s,sc}` (scattering in sample and absorption in sample and
+container), :math:`A_{c,sc}` (scattering in container and absorption in sample
+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
+are first converted to wavelength and the corrections are interpolated to match
+the sample as demonstrated in the example below.
+
+Usage
+-----
+
+**Example: using with legacy indirect corrections data**
+
+.. testcode:: exSampleAndCanIRISLegacyCorrections
+
+    # Load the sample and can
+    sample_ws = Load('irs26176_graphite002_red.nxs')
+    can_ws = Load('irs26173_graphite002_red.nxs')
+
+    # Convert sample and container workspaces to wavelength
+    sample_ws = ConvertUnits(InputWorkspace=sample_ws,
+                             Target='Wavelength',
+                             EMode='Indirect',
+                             EFixed=1.845)
+    can_ws = ConvertUnits(InputWorkspace=can_ws,
+                          Target='Wavelength',
+                          EMode='Indirect',
+                          EFixed=1.845)
+
+    # Load the corrections workspace
+    corrections_ws = Load('irs26176_graphite002_cyl_Abs.nxs')
+
+    # Interpolate each of the correction factor workspaces to match the
+    # binning of the smaple
+    # Required to use corrections from the old indirect calculate
+    # corrections routines
+    for factor_ws in corrections_ws:
+        SplineInterpolation(WorkspaceToMatch=sample_ws,
+                            WorkspaceToInterpolate=factor_ws,
+                            OutputWorkspace=factor_ws,
+                            OutputWorkspaceDeriv='')
+
+    corr = ApplyPaalmanPingsCorrection(SampleWorkspace=sample_ws,
+                                       CorrectionsWorkspace=corrections_ws,
+                                       CanWorkspace=can_ws)
+
+    print 'Corrected workspace has %d spectra over %d bins' % (
+          corr.getNumberHistograms(), corr.blocksize())
+
+    print 'Type of correction applied: %s' % (
+          corr.getRun()['corrections_type'].value)
+
+Output:
+
+.. testoutput:: exSampleAndCanIRISLegacyCorrections
+
+    Corrected workspace has 10 spectra over 1905 bins
+    Type of correction applied: sample_and_can_corrections
+
+.. categories::
diff --git a/Code/Mantid/docs/source/algorithms/IndirectAnnulusAbsorption-v1.rst b/Code/Mantid/docs/source/algorithms/IndirectAnnulusAbsorption-v1.rst
index 90eebc58ce6c8a7e9c96d010e4bebe236211b8c1..2f1343fcdcf645d6de0258c38027a3b4c1bbb9ea 100644
--- a/Code/Mantid/docs/source/algorithms/IndirectAnnulusAbsorption-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/IndirectAnnulusAbsorption-v1.rst
@@ -10,11 +10,12 @@ Description
 -----------
 
 Calculates and applies corrections for scattering abs absorption in a annular
-sample for a run on an indirect inelastic instrument, optionally also performing
-a simple can subtraction is a container workspace is provided.
+sample for a run on an indirect inelastic instrument, optionally allowing for
+the subtraction or corrections of the container.
 
-The corrections workspace (:math:`A_{s,s}`) is the standard Paalman and Pings
-attenuation factor for absorption and scattering in the sample.
+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 thsi algorithm.
 
 Usage
 -----
@@ -28,36 +29,81 @@ Usage
   red_ws = LoadNexusProcessed(Filename='irs26176_graphite002_red.nxs')
   can_ws = LoadNexusProcessed(Filename='irs26173_graphite002_red.nxs')
 
-  corrected, ass = IndirectAnnulusAbsorption(SampleWorkspace=red_ws,
-                                             CanWorkspace=can_ws,
-                                             CanScaleFactor=0.8,
-                                             ChemicalFormula='H2-O',
-                                             CanInnerRadius=0.2,
-                                             SampleInnerRadius=0.15,
-                                             SampleOuterRadius=0.16,
-                                             CanOuterRadius=0.22,
-                                             Events=200)
+  corrected, fact = IndirectAnnulusAbsorption(SampleWorkspace=red_ws,
+                                              SampleChemicalFormula='H2-O',
+                                              CanWorkspace=can_ws,
+                                              CanScaleFactor=0.8,
+                                              CanInnerRadius=0.19,
+                                              SampleInnerRadius=0.2,
+                                              SampleOuterRadius=0.25,
+                                              CanOuterRadius=0.26,
+                                              Events=200)
+
+  ass = fact[0]
 
   print ('Corrected workspace is intensity against %s'
         % (corrected.getAxis(0).getUnit().caption()))
 
-  print ('Corrections workspace is %s against %s'
+  print ('Ass workspace is %s against %s'
         % (ass.YUnitLabel(), ass.getAxis(0).getUnit().caption()))
 
-
 .. testcleanup:: SampleCorrectionsWithCanSubtraction
 
    DeleteWorkspace(red_ws)
    DeleteWorkspace(can_ws)
    DeleteWorkspace(corrected)
-   DeleteWorkspace(ass)
+   DeleteWorkspace(fact)
 
 **Output:**
 
-
 .. testoutput:: SampleCorrectionsWithCanSubtraction
 
   Corrected workspace is intensity against Energy transfer
-  Corrections workspace is Attenuation factor against Wavelength
+  Ass workspace is Attenuation factor against Wavelength
+
+**Example - Sample corrections for IRIS:**
+
+.. testcode:: SampleAndCanCorrections
+
+  red_ws = LoadNexusProcessed(Filename='irs26176_graphite002_red.nxs')
+  can_ws = LoadNexusProcessed(Filename='irs26173_graphite002_red.nxs')
+
+  corrected, fact = IndirectAnnulusAbsorption(SampleWorkspace=red_ws,
+                                              SampleChemicalFormula='H2-O',
+                                              CanWorkspace=can_ws,
+                                              CanChemicalFormula='H2-O',
+                                              CanInnerRadius=0.19,
+                                              SampleInnerRadius=0.2,
+                                              SampleOuterRadius=0.25,
+                                              CanOuterRadius=0.26,
+                                              Events=200,
+                                              UseCanCorrections=True)
+
+  ass = fact[0]
+  acc = fact[1]
+
+  print ('Corrected workspace is intensity against %s'
+        % (corrected.getAxis(0).getUnit().caption()))
+
+  print ('Ass workspace is %s against %s'
+        % (ass.YUnitLabel(), ass.getAxis(0).getUnit().caption()))
+
+  print ('Acc workspace is %s against %s'
+        % (acc.YUnitLabel(), acc.getAxis(0).getUnit().caption()))
+
+.. testcleanup:: SampleAndCanCorrections
+
+   DeleteWorkspace(red_ws)
+   DeleteWorkspace(can_ws)
+   DeleteWorkspace(corrected)
+   DeleteWorkspace(fact)
+
+**Output:**
+
+.. testoutput:: SampleAndCanCorrections
+
+  Corrected workspace is intensity against Energy transfer
+  Ass workspace is Attenuation factor against Wavelength
+  Acc workspace is Attenuation factor against Wavelength
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/IndirectCylinderAbsorption-v1.rst b/Code/Mantid/docs/source/algorithms/IndirectCylinderAbsorption-v1.rst
index eb7c25150ad5e01ea9cf7942029c6b733b17c578..ef2b38b704093025d74550b2c0ede9033bfca67e 100644
--- a/Code/Mantid/docs/source/algorithms/IndirectCylinderAbsorption-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/IndirectCylinderAbsorption-v1.rst
@@ -9,12 +9,13 @@
 Description
 -----------
 
-Calculates and applies corrections for scattering abs absorption in a
+Calculates and applies corrections for scattering and absorption in a
 cylindrical sample for a run on an indirect inelastic instrument, optionally
-also performing a simple can subtraction is a container workspace is provided.
+allowing for the subtraction or corrections of the container.
 
-The corrections workspace (:math:`A_{s,s}`) is the standard Paalman and Pings
-attenuation factor for absorption and scattering in the sample.
+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 thsi algorithm.
 
 Usage
 -----
@@ -28,32 +29,78 @@ Usage
   red_ws = LoadNexusProcessed(Filename='irs26176_graphite002_red.nxs')
   can_ws = LoadNexusProcessed(Filename='irs26173_graphite002_red.nxs')
 
-  corrected, ass = IndirectCylinderAbsorption(SampleWorkspace=red_ws,
-                                              CanWorkspace=can_ws,
-                                              CanScaleFactor=0.8,
-                                              ChemicalFormula='H2-O',
-                                              SampleRadius=0.2)
+  corrected, fact = IndirectCylinderAbsorption(SampleWorkspace=red_ws,
+                                               SampleChemicalFormula='H2-O',
+                                               CanWorkspace=can_ws,
+                                               CanScaleFactor=0.8,
+                                               SampleRadius=0.2,
+                                               UseCanCorrections=False,
+                                               Events=100)
+
+  ass = fact[0]
 
   print ('Corrected workspace is intensity against %s'
         % (corrected.getAxis(0).getUnit().caption()))
 
-  print ('Corrections workspace is %s against %s'
+  print ('Ass workspace is %s against %s'
         % (ass.YUnitLabel(), ass.getAxis(0).getUnit().caption()))
 
-
 .. testcleanup:: SampleCorrectionsWithCanSubtraction
 
    DeleteWorkspace(red_ws)
    DeleteWorkspace(can_ws)
    DeleteWorkspace(corrected)
-   DeleteWorkspace(ass)
+   DeleteWorkspace(fact)
 
 **Output:**
 
-
 .. testoutput:: SampleCorrectionsWithCanSubtraction
 
-  Corrected workspace is intensity against Energy transfer
-  Corrections workspace is Attenuation factor against Wavelength
+   Corrected workspace is intensity against Energy transfer
+   Ass workspace is Attenuation factor against Wavelength
+
+**Example - Sample and container corrections for IRIS:**
+
+.. testcode:: SampleAndCanCorrections
+
+  red_ws = LoadNexusProcessed(Filename='irs26176_graphite002_red.nxs')
+  can_ws = LoadNexusProcessed(Filename='irs26173_graphite002_red.nxs')
+
+  corrected, fact = IndirectCylinderAbsorption(SampleWorkspace=red_ws,
+                                               SampleChemicalFormula='H2-O',
+                                               SampleRadius=0.2,
+                                               CanWorkspace=can_ws,
+                                               CanScaleFactor=0.8,
+                                               CanChemicalFormula='V',
+                                               CanRadius=0.22,
+                                               UseCanCorrections=True,
+                                               Events=100)
+
+  ass = fact[0]
+  acc = fact[1]
+
+  print ('Corrected workspace is intensity against %s'
+        % (corrected.getAxis(0).getUnit().caption()))
+
+  print ('Ass workspace is %s against %s'
+        % (ass.YUnitLabel(), ass.getAxis(0).getUnit().caption()))
+
+  print ('Acc workspace is %s against %s'
+        % (acc.YUnitLabel(), acc.getAxis(0).getUnit().caption()))
+
+.. testcleanup:: SampleAndCanCorrections
+
+   DeleteWorkspace(red_ws)
+   DeleteWorkspace(can_ws)
+   DeleteWorkspace(corrected)
+   DeleteWorkspace(fact)
+
+**Output:**
+
+.. testoutput:: SampleAndCanCorrections
+
+   Corrected workspace is intensity against Energy transfer
+   Ass workspace is Attenuation factor against Wavelength
+   Acc workspace is Attenuation factor against Wavelength
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/IndirectFlatPlateAbsorption-v1.rst b/Code/Mantid/docs/source/algorithms/IndirectFlatPlateAbsorption-v1.rst
index 0557ecb326b9a7cfc0630f34e8ce1d1c2e70e9fe..7e83f5ec675d28a666b8a34aedc750e328be1114 100644
--- a/Code/Mantid/docs/source/algorithms/IndirectFlatPlateAbsorption-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/IndirectFlatPlateAbsorption-v1.rst
@@ -10,11 +10,12 @@ Description
 -----------
 
 Calculates and applies corrections for scattering abs absorption in a flat plate
-sample for a run on an indirect inelastic instrument, optionally also performing
-a simple can subtraction is a container workspace is provided.
+sample for a run on an indirect inelastic instrument, optionally allowing for
+the subtraction or corrections of the container.
 
-The corrections workspace (:math:`A_{s,s}`) is the standard Paalman and Pings
-attenuation factor for absorption and scattering in the sample.
+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 thsi algorithm.
 
 Usage
 -----
@@ -28,35 +29,81 @@ Usage
   red_ws = LoadNexusProcessed(Filename='irs26176_graphite002_red.nxs')
   can_ws = LoadNexusProcessed(Filename='irs26173_graphite002_red.nxs')
 
-  corrected, ass = IndirectFlatPlateAbsorption(SampleWorkspace=red_ws,
-                                               CanWorkspace=can_ws,
-                                               CanScaleFactor=0.8,
-                                               ChemicalFormula='H2-O',
-                                               SampleHeight=1,
-                                               SampleWidth=1,
-                                               SampleThickness=1,
-                                               ElementSize=1)
+  corrected, fact = IndirectFlatPlateAbsorption(SampleWorkspace=red_ws,
+                                                SampleChemicalFormula='H2-O',
+                                                CanWorkspace=can_ws,
+                                                CanScaleFactor=0.8,
+                                                SampleHeight=1,
+                                                SampleWidth=1,
+                                                SampleThickness=1,
+                                                ElementSize=1,
+                                                UseCanCorrections=False)
+
+  ass = fact[0]
 
   print ('Corrected workspace is intensity against %s'
         % (corrected.getAxis(0).getUnit().caption()))
 
-  print ('Corrections workspace is %s against %s'
+  print ('Ass workspace is %s against %s'
         % (ass.YUnitLabel(), ass.getAxis(0).getUnit().caption()))
 
-
 .. testcleanup:: SampleCorrectionsWithCanSubtraction
 
    DeleteWorkspace(red_ws)
    DeleteWorkspace(can_ws)
    DeleteWorkspace(corrected)
-   DeleteWorkspace(ass)
+   DeleteWorkspace(fact)
 
 **Output:**
 
-
 .. testoutput:: SampleCorrectionsWithCanSubtraction
 
-  Corrected workspace is intensity against Energy transfer
-  Corrections workspace is Attenuation factor against Wavelength
+   Corrected workspace is intensity against Energy transfer
+   Ass workspace is Attenuation factor against Wavelength
+
+**Example - Sample and container corrections for IRIS:**
+
+.. testcode:: SampleAndCanCorrections
+
+  red_ws = LoadNexusProcessed(Filename='irs26176_graphite002_red.nxs')
+  can_ws = LoadNexusProcessed(Filename='irs26173_graphite002_red.nxs')
+
+  corrected, fact = IndirectFlatPlateAbsorption(SampleWorkspace=red_ws,
+                                                SampleChemicalFormula='H2-O',
+                                                CanWorkspace=can_ws,
+                                                CanChemicalFormula='V',
+                                                CanScaleFactor=0.8,
+                                                SampleHeight=1,
+                                                SampleWidth=1,
+                                                SampleThickness=1,
+                                                ElementSize=1,
+                                                UseCanCorrections=True)
+
+  ass = fact[0]
+  acc = fact[1]
+
+  print ('Corrected workspace is intensity against %s'
+        % (corrected.getAxis(0).getUnit().caption()))
+
+  print ('Ass workspace is %s against %s'
+        % (ass.YUnitLabel(), ass.getAxis(0).getUnit().caption()))
+
+  print ('Acc workspace is %s against %s'
+        % (acc.YUnitLabel(), acc.getAxis(0).getUnit().caption()))
+
+.. testcleanup:: SampleAndCanCorrections
+
+   DeleteWorkspace(red_ws)
+   DeleteWorkspace(can_ws)
+   DeleteWorkspace(corrected)
+   DeleteWorkspace(fact)
+
+**Output:**
+
+.. testoutput:: SampleAndCanCorrections
+
+   Corrected workspace is intensity against Energy transfer
+   Ass workspace is Attenuation factor against Wavelength
+   Acc workspace is Attenuation factor against Wavelength
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/IntegrateEllipsoids-v1.rst b/Code/Mantid/docs/source/algorithms/IntegrateEllipsoids-v1.rst
index c64b003e766818d4182edddb6a8e23a1cf076013..831d0c6d5d858af5fb5ce90a6b224ede544d19e6 100644
--- a/Code/Mantid/docs/source/algorithms/IntegrateEllipsoids-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/IntegrateEllipsoids-v1.rst
@@ -162,7 +162,7 @@ Usage
 
 **Example - IntegrateEllipsoids:**
 
-The code iteslef works but disabled from doc tests as takes too long to complete. User should provide its own 
+The code itself works but disabled from doc tests as takes too long to complete. User should provide its own 
 event nexus file instead of **TOPAZ_3132_event.nxs** used within this example. The original **TOPAZ_3132_event.nxs**
 file is availible in `Mantid system tests repository <https://github.com/mantidproject/systemtests/tree/master/Data/TOPAZ_3132_event.nxs>`_.
 
diff --git a/Code/Mantid/docs/source/algorithms/IntegratePeaksMD-v2.rst b/Code/Mantid/docs/source/algorithms/IntegratePeaksMD-v2.rst
index 704b3cf2ce53deaaf40819d51773d39376e16bb4..20ec4aae8a90ee567c814fd446119c9c6716dd14 100644
--- a/Code/Mantid/docs/source/algorithms/IntegratePeaksMD-v2.rst
+++ b/Code/Mantid/docs/source/algorithms/IntegratePeaksMD-v2.rst
@@ -129,7 +129,7 @@ Usage
 
 **Example - IntegratePeaks:**
 
-The code iteslef works but disabled from doc tests as takes too long to complete. User should provide its own 
+The code itself works but disabled from doc tests as takes too long to complete. User should provide its own 
 event nexus file instead of **TOPAZ_3132_event.nxs** used within this example. The original **TOPAZ_3132_event.nxs**
 file is availible in `Mantid system tests repository <https://github.com/mantidproject/systemtests/tree/master/Data/TOPAZ_3132_event.nxs>`_.
 
diff --git a/Code/Mantid/docs/source/algorithms/LoadDNSLegacy-v1.rst b/Code/Mantid/docs/source/algorithms/LoadDNSLegacy-v1.rst
new file mode 100644
index 0000000000000000000000000000000000000000..369b381acf627d81d508958d0cf9efaeec993993
--- /dev/null
+++ b/Code/Mantid/docs/source/algorithms/LoadDNSLegacy-v1.rst
@@ -0,0 +1,39 @@
+.. algorithm::
+
+.. summary::
+
+.. alias::
+
+.. properties::
+
+Description
+-----------
+
+Loads a DNS legacy .d_dat data file into a :ref:`Workspace2D <Workspace2D>` with
+the given name.
+
+The loader rotates the detector bank in the position given in the data file.
+
+This algorithm only supports DNS instrument in its configuration before major upgrade. 
+
+Usage
+-----
+
+**Example - Load a DNS legacy .d_dat file:**
+
+.. code-block:: python
+
+   # data file.
+   datafile = 'dn134011vana.d_dat'
+
+   # Load dataset
+   ws = LoadDNSLegacy(datafile)
+
+   print "This workspace has", ws.getNumDims(), "dimensions and has", \
+        ws.getNumberHistograms(), "histograms."
+
+Output:
+
+   This workspace has 2 dimensions and has 24 histograms.
+
+.. categories::
diff --git a/Code/Mantid/docs/source/algorithms/LoadFITS-v1.rst b/Code/Mantid/docs/source/algorithms/LoadFITS-v1.rst
index 557447bc10fd2b485125fe0b816072e009c36e29..1184957082ea3bb9cc5fcd8427abafca0877988f 100644
--- a/Code/Mantid/docs/source/algorithms/LoadFITS-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/LoadFITS-v1.rst
@@ -9,6 +9,86 @@
 Description
 -----------
 
-Load data from FITS files
+Load FITS files, which typically contain images, into a
+:ref:`WorkspaceGroup <WorkspaceGroup>`. FITS stands for Flexible Image
+Transport System, see http://en.wikipedia.org/wiki/FITS. A new
+workspace (of type :ref:`Workspace2D <Workspace2D>`) is created for
+every FITS file loaded with this algorithm, and these workspaces are
+added into a :ref:`WorkspaceGroup <WorkspaceGroup>`. The group
+workspace is named as indicated in the OutputWorkspace input
+property. The workspaces included in the group are named with the same
+name and an appendix _1, _2, etc., incremented sequentially as new
+files are loaded with the same OutputWorkspace property.
+
+The current implementation of this algorithm only supports 2D files
+(FITS images with two axes), and it should in principle be able to
+load FITS files from different sources.
+
+The workspaces created by this algorithm contain one spectrum per
+pixel. The first spectrum correspond to the top-left corner and the
+last spectrum to the bottom-right corner.
+
+FITS header entries
+###################
+
+At a very minimum, the standard header entries SIMPLE, BITPIX, NAXIS,
+NAXIS1, and NAXIS2 must be present in the file.
+
+This algorithm interprets extension headers defined for the IMAT
+instrument (ISIS facility). The set of extension headers for the IMAT
+instrument is being defined as of this writing and specific support
+and/or functionality related to additional headers might be added in
+this algorithm.
+
+Child algorithms used
+#####################
+
+This algorithm uses one child algorithm:
+
+- :ref:`algm-LoadInstrument`, which looks for a description of the
+  instrument in the facilities definition file and if found reads it.
+  This algorithm is used only once when loading a set of FITS file
+  corresponding to the same instrument.
+
+Usage
+-----
+
+**Example**
+
+.. testcode:: LoadFITS
+
+    ws_name = 'FITSws'
+    wsg = LoadFITS(Filename='FITS_small_01.fits', OutputWorkspace=ws_name)
+    ws = wsg.getItem(0)
+
+    # A couple of standard FITS header entries
+    bpp_log = '_BITPIX'
+    try:
+        log = ws.getRun().getLogData(bpp_log).value
+        print "Bits per pixel: %s" % int(log)
+    except RuntimeError:
+        print "Could not find the keyword '%s' in this FITS file" % bpp_log
+
+    axis1_log = '_NAXIS1'
+    axis2_log = '_NAXIS2'
+    try:
+        log1 = ws.getRun().getLogData(axis1_log).value
+        log2 = ws.getRun().getLogData(axis2_log).value
+        print "FITS image size: %s x %s pixels" % (int(log1), int(log2))
+        print "Number of spectra in the output workspace: %d" % ws.getNumberHistograms()
+    except RuntimeError:
+        print "Could not find the keywords '%s' and '%s' in this FITS file" % (axis1_log, axis2_log)
+
+.. testcleanup:: LoadFITS
+
+    DeleteWorkspace(ws_name)
+
+Output:
+
+.. testoutput:: LoadFITS
+
+   Bits per pixel: 16
+   FITS image size: 512 x 512 pixels
+   Number of spectra in the output workspace: 262144
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst b/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst
new file mode 100644
index 0000000000000000000000000000000000000000..3e59022cd0409c6da999672d5aa8503719eaad40
--- /dev/null
+++ b/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst
@@ -0,0 +1,101 @@
+.. algorithm::
+
+.. summary::
+
+.. alias::
+
+.. properties::
+
+Description
+-----------
+
+The algorithm performs a fit of lattice parameters using the principle approach described in a paper by Pawley [Pawley]_. In this approach the reflection positions are calculated from lattice parameters and the reflection's Miller indices (:math:`hkl`), while the other profile parameters for each peak are freely refined.
+
+PawleyFit requires a MatrixWorkspace with at least one spectrum in terms of either :math:`d` or :math:`Q`, the index of the spectrum can be supplied to the algorithm as a parameter. Furthermore, the range which is used for refinement can be changed by setting the corresponding properties.
+
+In addition, a TableWorkspace with information about the reflections that are found in the spectrum must be passed as well. There must be four columns with the captions "HKL", "d", "FWHM (rel.)" and "Intensity". The HKL column can be supplied either as V3D or as a string with 3 numbers separated by space, comma or semi-colon and possibly surrounded by square brackets. One way to obtain such a table is to use three algorithms that are used in analysis of POLDI data, which produce tables in a suitable format. Details are given in the usage example section.
+
+Along with the workspaces containing fit results and parameter values, the algorithm also outputs the reduced :math:`\chi^2`-value, which is also written in the log.
+
+Usage
+-----
+
+.. include:: ../usagedata-note.txt
+
+For the usage example there is a calculated, theoretical diffraction pattern (including a bit of noise) for Silicon, which crystallizes in space group :math:`Fd\overline{3}m` and has a cubic cell with lattice parameter :math:`a=5.4311946\,\mathrm{\AA{}}`.
+
+.. testcode:: ExPawleySilicon
+
+    import numpy as np
+
+    # Load spectrum for Silicon in the d-range down to 0.7
+    si_spectrum = Load("PawleySilicon.nxs")
+
+    # In order to index the peaks later on, generate reflection for Si
+    Si = PoldiCreatePeaksFromCell(SpaceGroup='F d -3 m',
+                                  Atoms='Si 0 0 0 1.0 0.05',
+                                  a=5.43, LatticeSpacingMin=0.7)
+
+    print "Silicon has", Si.rowCount(), "unique reflections with d > 0.7."
+
+    # Find peaks in the spectrum
+    si_peaks = PoldiPeakSearch(si_spectrum)
+
+    # Index the peaks, will generate a workspace named 'Indexed_Si'
+    indexed = PoldiIndexKnownCompounds(si_peaks, CompoundWorkspaces='Si')
+
+    si_peaks_indexed = AnalysisDataService.retrieve('Indexed_Si')
+
+    # 3 peaks have two possibilities for indexing, because their d-values are identical
+    print "The number of peaks that were indexed:", si_peaks_indexed.rowCount()
+
+    # Run the actual fit with lattice parameters that are slightly off
+    si_fitted, si_cell, si_params, chi_square = PawleyFit(si_spectrum,
+                          CrystalSystem='Cubic',
+                          InitialCell='5.436 5.436 5.436',
+                          PeakTable=si_peaks_indexed)
+
+    si_cell = AnalysisDataService.retrieve("si_cell")
+
+    a = np.round(si_cell.cell(0, 1), 6)
+    a_err = np.round(si_cell.cell(0, 2), 6)
+    a_diff = np.round(np.fabs(a - 5.4311946), 6)
+
+    print "The lattice parameter was refined to a =", a, "+/-", a_err
+    print "The deviation from the actual parameter (a=5.4311946) is:", a_diff
+    print "This difference corresponds to", np.round(a_diff / a_err, 2), "standard deviations."
+    print "The reduced chi square of the fit is:", np.round(chi_square, 3)
+
+Running this script will generate a bit of output about the results of the different steps. At the end the lattice parameter differs less than one standard deviation from the actual value.
+
+.. testoutput:: ExPawleySilicon
+
+    Silicon has 18 unique reflections with d > 0.7.
+    The number of peaks that were indexed: 15
+    The lattice parameter was refined to a = 5.431205 +/- 1.6e-05
+    The deviation from the actual parameter (a=5.4311946) is: 1e-05
+    This difference corresponds to 0.63 standard deviations.
+    The reduced chi square of the fit is: 1.04
+
+.. testcleanup:: ExPawleySilicon
+
+    AnalysisDataService.remove("si_spectrum")
+    AnalysisDataService.remove("Si")
+    AnalysisDataService.remove("si_peaks")
+    AnalysisDataService.remove("indexed")
+    AnalysisDataService.remove("si_fitted")
+    AnalysisDataService.remove("si_cell")
+    AnalysisDataService.remove("si_params")
+
+It's important to check the output data, which is found in the workspace labeled si_fitted. Plotting it should show that the residuals are just containing background noise and no systematic deviations. Of course, depending on the sample and the measurement this will differ between cases.
+
+.. figure:: /images/PawleyFitResultTheoreticalSilicon.png
+   :figwidth: 15 cm
+   :align: center
+   :alt: Result of the Pawley fit example with silicon.
+
+   Result of the Pawley fit example with silicon.
+
+.. [Pawley] Pawley, G. S. “Unit-Cell Refinement from Powder Diffraction Scans.”, J. Appl. Crystallogr. 14, 1981, 357. doi:10.1107/S0021889881009618.
+
+.. categories::
diff --git a/Code/Mantid/docs/source/algorithms/PoldiCreatePeaksFromFile-v1.rst b/Code/Mantid/docs/source/algorithms/PoldiCreatePeaksFromFile-v1.rst
new file mode 100644
index 0000000000000000000000000000000000000000..a25b5e8d3f8b3607adb6f579a7aab1a8662d6fa6
--- /dev/null
+++ b/Code/Mantid/docs/source/algorithms/PoldiCreatePeaksFromFile-v1.rst
@@ -0,0 +1,87 @@
+
+.. algorithm::
+
+.. summary::
+
+.. alias::
+
+.. properties::
+
+Description
+-----------
+
+Some steps in the analysis of POLDI data require that detected peaks are indexed. This can be done by using
+:ref:`algm-PoldiIndexKnownCompounds`, which accepts a table with unindexed peaks and one or more workspaces with
+calculated peaks corresponding to the crystal structures that are expected in the sample. These can be calculated
+using the algorithm :ref:`algm-PoldiCreatePeaksFromCell`. Calling this algorithm over and over with the same
+parameters is not practical, but storing the tables is not practical either, since lattice parameters may change
+slightly from sample to sample.
+
+PoldiCreatePeaksFromFile reads a text file which contains one or more crystal structure definitions. Since the
+analysis requires information mainly about the lattice and the symmetry, the format is very simple. The following
+block shows how such a file would look when there are two compounds:
+
+.. code-block:: none
+
+    # The name may contain letters, numbers and _
+    Iron_FCC {
+        # Up to 6 values in the order a, b, c, alpha, beta, gamma.
+        # Lattice parameters are given in Angstrom.
+        Lattice: 3.65
+        Spacegroup: F m -3 m
+        Atoms: {
+            # Element x y z are mandatory. Optional occupancy and isotropic ADP (in Angstrom^2)
+            Fe 0.0 0.0 0.0
+        }
+    }
+
+    Iron_BCC {
+        Lattice: 2.88
+        Spacegroup: F m -3 m
+        Atoms: {
+            Fe 0.0 0.0 0.0
+        }
+    }
+
+Note that only the atoms in the asymmetric unit need to be specified, the space group is used to generate all
+equivalent atoms. This information is used to determine systematic absences, while the space group is also used by
+some POLDI algorithms to obtain the point group to get reflection multiplicities and more. Anything that follows the
+`#`-character is considered a comment and is ignored by the parser to allow documentation of the crystal structures
+if necessary.
+
+The algorithm will always produce a WorkspaceGroup which contains as many peak tables as compounds specified in the
+file.
+
+Usage
+-----
+
+.. include:: ../usagedata-note.txt
+
+The following usage example takes up the file showed above and passes it to the algorithm.
+
+.. testcode::
+
+    # Create two tables with expected peaks directly from a file
+    compounds = PoldiCreatePeaksFromFile('PoldiCrystalFileExample.dat', LatticeSpacingMin=0.7)
+
+    compound_count = compounds.getNumberOfEntries()
+    print 'Number of loaded compounds:', compound_count
+
+    for i in range(compound_count):
+        ws = compounds.getItem(i)
+        print 'Compound ' + str(i + 1) +':', ws.getName(), 'has', ws.rowCount(), 'reflections in the resolution range.'
+
+
+The script produces a WorkspaceGroup which contains a table with reflections for each compound in the file:
+
+.. testoutput::
+
+    Number of loaded compounds: 2
+    Compound 1: Iron_FCC has 11 reflections in the resolution range.
+    Compound 2: Iron_BCC has 8 reflections in the resolution range.
+
+.. testcleanup::
+
+    DeleteWorkspace('compounds')
+
+.. categories::
diff --git a/Code/Mantid/docs/source/algorithms/SCDCalibratePanels-v1.rst b/Code/Mantid/docs/source/algorithms/SCDCalibratePanels-v1.rst
index 0ddba6913fe7ea9f4d9a99d6b3b81326d8d5b01c..1f98aa15a476e3838012d2570b2cee52b2ba01b5 100644
--- a/Code/Mantid/docs/source/algorithms/SCDCalibratePanels-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/SCDCalibratePanels-v1.rst
@@ -95,4 +95,17 @@ algorithm. To do so select the workspace, which you have calibrated as
 the InputWorkspace and the workspace you want to copy the calibration
 to, the OutputWorkspace.
 
+Usage
+------
+
+**Example - SCDCalibratePanels:**
+
+	LoadIsawPeaks(Filename='MANDI_801.peaks', OutputWorkspace='peaks')
+	SCDCalibratePanels(PeakWorkspace='peaks',DetCalFilename='mandi_801.DetCal',XmlFilename='mandi_801.xml',a=74,b=74.5,c=99.9,alpha=90,beta=90,gamma=60)
+	Load(Filename='MANDI_801_event.nxs', OutputWorkspace='MANDI_801_event')
+	CloneWorkspace(InputWorkspace='MANDI_801_event', OutputWorkspace='MANDI_801_event_xml')
+	LoadParameterFile(Workspace='MANDI_801_event_xml', Filename='mandi_801.xml')
+	RenameWorkspace(InputWorkspace='MANDI_801_event_xml', OutputWorkspace='MANDI_801_event_DetCal')
+	LoadIsawDetCal(InputWorkspace='MANDI_801_event_DetCal', Filename='mandi_801.DetCal')
+	
 .. categories::
diff --git a/Code/Mantid/docs/source/fitfunctions/PawleyFunction.rst b/Code/Mantid/docs/source/fitfunctions/PawleyFunction.rst
new file mode 100644
index 0000000000000000000000000000000000000000..f4b6333060230d39fb450710b9e144e16b6fd996
--- /dev/null
+++ b/Code/Mantid/docs/source/fitfunctions/PawleyFunction.rst
@@ -0,0 +1,20 @@
+.. _func-PawleyFunction:
+
+==============
+PawleyFunction
+==============
+
+.. index:: PawleyFunction
+
+Description
+-----------
+
+The basic principle of fitting unit cell parameters to a complete powder diffraction pattern has been described by Pawley. Instead allowing each peak to have a freely selectable position, these positions are calculated as a result from the unit cell parameters. All other parameters of the peaks are refined independently. The implementation of the function differs from the method described in the paper in some points, for example the number of parameters can not change during the refinement (no reflections will be added or removed).
+
+Since the function requires special setup (assignment of HKLs, selection of crystal system and profile function), there is an algorithm that can perform a Pawley-type fit with different input data. Please see the documentation of :ref:`algm-PawleyFit` for details on how to use it.
+
+.. attributes::
+
+.. properties::
+
+.. categories::
diff --git a/Code/Mantid/docs/source/images/PawleyFitResultTheoreticalSilicon.png b/Code/Mantid/docs/source/images/PawleyFitResultTheoreticalSilicon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce92ee4e37bea1e5ef4ac39eafce559922ab41ed
Binary files /dev/null and b/Code/Mantid/docs/source/images/PawleyFitResultTheoreticalSilicon.png differ
diff --git a/Code/Mantid/docs/source/interfaces/Muon_ALC.rst b/Code/Mantid/docs/source/interfaces/Muon_ALC.rst
new file mode 100644
index 0000000000000000000000000000000000000000..44496c7921e25d0e3fc4ea2c866ac87332169f62
--- /dev/null
+++ b/Code/Mantid/docs/source/interfaces/Muon_ALC.rst
@@ -0,0 +1,124 @@
+Muon ALC
+========
+
+.. contents:: Table of Contents
+  :local:
+
+Overview
+--------
+
+The Muon ALC interface, which is short for Avoided Level Crossing, aims at 
+handling frequent analysis on e.g. HIFI. It uses simple point-and-click to 
+analyse a sequence of datasets collected with different parameter values, for 
+instance different magnetic fields, temperature, etc, and study how this 
+affects asymmetry. There are currently three steps in the analysis. 
+
+Data Loading
+------------
+
+The Data Loading step, provides an interface for the 
+:ref:`PlotAsymmetryByLogValue <algm-PlotAsymmetryByLogValue>` algorithm, 
+in which a sequence of runs are loaded through the fields 
+*First* and *Last*. All datasets with run number between these limits will be 
+loaded, and an error message will be shown if any of them is missing. The 
+user must supply the log data that will be used as X parameter from the list 
+of available log values.
+
+.. interface:: ALC
+  :widget: dataLoadingView
+  :align: center
+  :width: 800
+
+Options
+~~~~~~~
+
+First
+  First run of the sequence of datasets.
+
+Last
+  Last run of the sequence of datasets.
+
+Log
+  Log value to use as X parameter
+
+Dead Time Correction
+  Type of dead time corrections to apply. Options are *None*, in which case no 
+  corrections will be applied, *From Data File*, to load corrections from 
+  the input dataset itself, or *From Custom File*, to load corrections from a 
+  specified nexus file.
+
+Grouping
+  Detector grouping to apply. *Auto* will load the grouping information contained 
+  in the run file, while *Custom* allows to specify the list of spectra for both the 
+  forward and backward groups.
+
+Periods
+  Period number to use as red data. The *Subtract* option, if checked, allows to 
+  select the green period number that will be subtracted to the red data.
+
+Calculation
+  Type of calculation, *Integral* or *Differential*, together with the time limits.
+
+?
+  Shows this help page.
+
+Load
+  Computes the asymmetry according to selected options and displays it against the 
+  chosen log value.
+
+Baseline Modelling
+------------------
+
+In the Baseline Modelling step, the user can fit the baseline by selecting which 
+sections of the data should be used in the fit, and what the baseline fit 
+function should be. To select a baseline function, right-click on the *Function* 
+region, then *Add function* and choose among the different possibilities. Then 
+pick the desired fitting sections. 
+
+.. interface:: ALC
+  :widget: baselineModellingView
+  :align: center
+  :width: 400
+
+Options
+~~~~~~~
+
+Function
+  Right-click on the blank area to add a baseline function.
+
+Sections
+  Right-click on the blank area to add as many sections as needed to 
+  select the ranges to fit.
+
+?
+  Shows this help page.
+
+Fit
+  Fits the data.
+  
+Peak Fitting
+------------
+
+In the Peak Fitting step, data with the baseline subtracted are shown in 
+the right panel. The user can study the peaks of interest all with the same simple 
+interface. To add a new peak, right-click on the Peaks region, then select 
+*Add function* and choose among the different possibilities in the category Peak.
+
+.. interface:: ALC
+  :widget: peakFittingView
+  :align: center
+  :width: 600
+
+Options
+~~~~~~~
+
+Peaks
+  Right-click on the blank area to add a peak function.
+
+?
+  Shows this help page.
+
+Fit
+  Fits the data.
+
+.. categories:: Interfaces Muon
diff --git a/Code/Mantid/instrument/ALF_Definition.xml b/Code/Mantid/instrument/ALF_Definition.xml
index 331f26d6a83d6e62b358c57cec515bdab2477f10..f9c2c35766952edb35428d9613ad15e9dacdead0 100644
--- a/Code/Mantid/instrument/ALF_Definition.xml
+++ b/Code/Mantid/instrument/ALF_Definition.xml
@@ -5,8 +5,8 @@
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 http://schema.mantidproject.org/IDF/1.0/IDFSchema.xsd"
  name="ALF" valid-from   ="1900-01-31 23:59:59"
-                        valid-to     ="2100-01-31 23:59:59"
-		        last-modified="2009-01-15 00:00:00">
+                        valid-to     ="2015-03-16 23:59:59"
+		        last-modified="2015-03-27 00:00:00">
  
    <defaults>
      <length unit="meter"/>
diff --git a/Code/Mantid/instrument/ALF_Definition_20130317-.xml b/Code/Mantid/instrument/ALF_Definition_20130317-.xml
new file mode 100644
index 0000000000000000000000000000000000000000..034b567050c4302a4700d12d652fe2e0b40d5820
--- /dev/null
+++ b/Code/Mantid/instrument/ALF_Definition_20130317-.xml
@@ -0,0 +1,789 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- For help on the notation used to specify an Instrument Definition File 
+     see http://www.mantidproject.org/IDF -->
+<instrument xmlns="http://www.mantidproject.org/IDF/1.0" 
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 http://schema.mantidproject.org/IDF/1.0/IDFSchema.xsd"
+ name="ALF" valid-from   ="2015-03-17 00:00:00"
+                        valid-to     ="2100-01-31 23:59:59"
+		        last-modified="2015-03-27 00:00:00">
+ 
+   <defaults>
+     <length unit="meter"/>
+     <angle unit="degree"/>
+ <location r="0.0" t="0.0" p="0.0" ang="0.0" axis-x="0.0" axis-y="0.0" axis-z="1.0"/>
+     <reference-frame>
+       <!-- The z-axis is set parallel to and in the direction of the beam. the 
+        y-axis points up and the coordinate system is right handed. -->
+       <along-beam axis="z"/>
+       <pointing-up axis="y"/>
+       <handedness val="right"/>
+       <origin val="beam" /> 
+     </reference-frame>
+     <!-- Comment "components-are-facing" out if you dont want the
+     components defined in this file to face a position by default -->    
+     <components-are-facing x="0.0" y="0.0" z="0.0" />
+     <default-view view="cylindrical_y"/>
+   </defaults>
+   <!-- LIST OF PHYSICAL COMPONENTS (which the instrument consists of) -->
+   <!-- detector components -->
+    <properties>
+   </properties>
+
+   <component type="monitors" idlist="monitors">
+     <location/>
+   </component>
+<!--
+<component type="ALFpack1" idlist="ALFpack1">
+<location />
+</component>
+<component type="ALFpack2" idlist="ALFpack2">
+<location />
+</component>
+<component type="ALFpack3" idlist="ALFpack3">
+<location />
+</component> -->
+<component type="ALFdetectors" idlist="ALFdetectors">
+<location />
+</component>
+
+<!--
+<component type="ALFextratube1" idlist="ALFextratube1">
+<location />
+</component>
+<component type="ALFextratube2" idlist="ALFextratube2">
+<location />
+</component>
+-->
+<!-- source and sample-position components -->
+   <component type="undulator">
+     <location z="-14.9165"> <facing val="none"/> </location>
+   </component>
+ 
+   <component type="nickel-holder">
+     <location> <facing val="none"/> </location>
+   </component>
+ 
+   <!-- DEFINITION OF TYPES -->
+   <!-- Source types -->
+   <type name="undulator" is="Source">
+     <properties />
+     <cylinder id="some-shape">
+       <centre-of-bottom-base r="0.0" t="0.0" p="0.0" />
+       <axis x="0.0" y="0.0" z="1.0" /> 
+       <radius val="0.01" />
+       <height val="0.03" />
+     </cylinder> 
+     <algebra val="some-shape" />
+   </type>
+ 
+   <!-- Sample-position types -->
+   <type name="nickel-holder" is="SamplePos">
+     <properties />
+     <sphere id="some-shape">
+       <centre x="0.0"  y="0.0" z="0.0" />
+       <radius val="0.03" />
+     </sphere>
+     <algebra val="some-shape" />
+   </type>
+ 
+   <!-- Detectors types -->
+   <type name="monitors">
+     <component type="monitor">
+       <location r="2.03" t="180.0" p="0.0" name="monitor1" />
+       <location r="1.54" t="0.0" p="0.0" name="monitor2" />
+       <location r="4.0" t="0.0" p="0.0" name="monitor3" />
+     </component>
+   </type>
+
+<type name="ALFdetectors">
+ <component type="ALF24tubes">
+<location  x="0.7309    " z="  1.3328    "> <facing x="0" y="0" z="0"/> </location>
+ </component>
+ </type>
+
+<!-- <type name="ALFpack1">
+ <component type="ALFpack">
+<location  x="0.52833    " z="  1.4252    "> <facing x="0" y="0" z="0"/> </location>
+ </component>
+ </type>
+<type name="ALFpack2">
+ <component type="ALFpack">
+<location  x="0.7309    " z="  1.3328    "> <facing x="0" y="0" z="0"/> </location>
+ </component>
+ </type>
+<type name="ALFpack3">
+ <component type="ALFpack">
+<location  x="0.91857    " z="  1.21105    "> <facing x="0" y="0" z="0"/> </location>
+ </component>
+ </type> -->
+<!--
+<type name="ALFextratube1">
+ <component type="ALFtube">
+<location  x="1.52    " z="  -0.0200    "> <facing x="0" y="0" z="0"/> </location>
+ </component>
+ </type>
+<type name="ALFextratube2">
+ <component type="ALFtube">
+<location  x="1.52    " z="  0.0200    "> <facing x="0" y="0" z="0"/> </location>
+ </component>
+ </type>
+-->
+
+ <type name="ALF24tubes">
+ <properties />
+ <component type="ALFtube" >
+<location  x="   -0.3220    " z="  0.00000" name="tube1" />
+<location  x="   -0.2940    " z="  0.00000" name="tube2" />
+<location  x="   -0.2660    " z="  0.00000" name="tube3" />
+<location  x="   -0.2380    " z="  0.00000" name="tube4" />
+<location  x="   -0.2100    " z="  0.00000" name="tube5" />
+<location  x="   -0.1820    " z="  0.00000" name="tube6" />
+<location  x="   -0.1540    " z="  0.00000" name="tube7" />
+<location  x="   -0.1260    " z="  0.00000" name="tube8" />
+<location  x="   -0.0980    " z="  0.00000" name="tube9" />
+<location  x="   -0.0700    " z="  0.00000" name="tube10" />
+<location  x="   -0.0420    " z="  0.00000" name="tube11" />
+<location  x="   -0.0140    " z="  0.00000" name="tube12" />
+<location  x="   0.01400    " z="  0.00000" name="tube13" />
+<location  x="   0.04200    " z="  0.00000" name="tube14" />
+<location  x="   0.07000    " z="  0.00000" name="tube15" />
+<location  x="   0.09800    " z="  0.00000" name="tube16" />
+<location  x="   0.12600    " z="  0.00000" name="tube17" />
+<location  x="   0.15400    " z="  0.00000" name="tube18" />
+<location  x="   0.18200    " z="  0.00000" name="tube19" />
+<location  x="   0.21000    " z="  0.00000" name="tube20" />
+<location  x="   0.23800    " z="  0.00000" name="tube21" />
+<location  x="   0.26600    " z="  0.00000" name="tube22" />
+<location  x="   0.29400    " z="  0.00000" name="tube23" />
+<location  x="   0.32200    " z="  0.00000" name="tube24" />
+
+ </component>
+ </type>
+
+<!--
+ <type name="ALFpack">
+ <properties />
+ <component type="ALFtube" >
+<location  x="   -0.0980    " z="  0.00000" name="tube1" />
+<location  x="   -0.0700    " z="  0.00000" name="tube2" />
+<location  x="   -0.0420    " z="  0.00000" name="tube3" />
+<location  x="   -0.0140    " z="  0.00000" name="tube4" />
+<location  x="   0.01400    " z="  0.00000" name="tube5" />
+<location  x="   0.04200    " z="  0.00000" name="tube6" />
+<location  x="   0.07000    " z="  0.00000" name="tube7" />
+<location  x="   0.09800    " z="  0.00000" name="tube8" />
+ </component>
+ </type> -->
+
+<type name="ALFtube" outline="yes">
+ <component type="pixel">
+<location y=" -0.498047" />
+<location y=" -0.496094" />
+<location y=" -0.494141" />
+<location y=" -0.492188" />
+<location y=" -0.490234" />
+<location y=" -0.488281" />
+<location y=" -0.486328" />
+<location y=" -0.484375" />
+<location y=" -0.482422" />
+<location y=" -0.480469" />
+<location y=" -0.478516" />
+<location y=" -0.476563" />
+<location y=" -0.474609" />
+<location y=" -0.472656" />
+<location y=" -0.470703" />
+<location y=" -0.468750" />
+<location y=" -0.466797" />
+<location y=" -0.464844" />
+<location y=" -0.462891" />
+<location y=" -0.460938" />
+<location y=" -0.458984" />
+<location y=" -0.457031" />
+<location y=" -0.455078" />
+<location y=" -0.453125" />
+<location y=" -0.451172" />
+<location y=" -0.449219" />
+<location y=" -0.447266" />
+<location y=" -0.445313" />
+<location y=" -0.443359" />
+<location y=" -0.441406" />
+<location y=" -0.439453" />
+<location y=" -0.437500" />
+<location y=" -0.435547" />
+<location y=" -0.433594" />
+<location y=" -0.431641" />
+<location y=" -0.429688" />
+<location y=" -0.427734" />
+<location y=" -0.425781" />
+<location y=" -0.423828" />
+<location y=" -0.421875" />
+<location y=" -0.419922" />
+<location y=" -0.417969" />
+<location y=" -0.416016" />
+<location y=" -0.414063" />
+<location y=" -0.412109" />
+<location y=" -0.410156" />
+<location y=" -0.408203" />
+<location y=" -0.406250" />
+<location y=" -0.404297" />
+<location y=" -0.402344" />
+<location y=" -0.400391" />
+<location y=" -0.398438" />
+<location y=" -0.396484" />
+<location y=" -0.394531" />
+<location y=" -0.392578" />
+<location y=" -0.390625" />
+<location y=" -0.388672" />
+<location y=" -0.386719" />
+<location y=" -0.384766" />
+<location y=" -0.382813" />
+<location y=" -0.380859" />
+<location y=" -0.378906" />
+<location y=" -0.376953" />
+<location y=" -0.375000" />
+<location y=" -0.373047" />
+<location y=" -0.371094" />
+<location y=" -0.369141" />
+<location y=" -0.367188" />
+<location y=" -0.365234" />
+<location y=" -0.363281" />
+<location y=" -0.361328" />
+<location y=" -0.359375" />
+<location y=" -0.357422" />
+<location y=" -0.355469" />
+<location y=" -0.353516" />
+<location y=" -0.351563" />
+<location y=" -0.349609" />
+<location y=" -0.347656" />
+<location y=" -0.345703" />
+<location y=" -0.343750" />
+<location y=" -0.341797" />
+<location y=" -0.339844" />
+<location y=" -0.337891" />
+<location y=" -0.335938" />
+<location y=" -0.333984" />
+<location y=" -0.332031" />
+<location y=" -0.330078" />
+<location y=" -0.328125" />
+<location y=" -0.326172" />
+<location y=" -0.324219" />
+<location y=" -0.322266" />
+<location y=" -0.320313" />
+<location y=" -0.318359" />
+<location y=" -0.316406" />
+<location y=" -0.314453" />
+<location y=" -0.312500" />
+<location y=" -0.310547" />
+<location y=" -0.308594" />
+<location y=" -0.306641" />
+<location y=" -0.304688" />
+<location y=" -0.302734" />
+<location y=" -0.300781" />
+<location y=" -0.298828" />
+<location y=" -0.296875" />
+<location y=" -0.294922" />
+<location y=" -0.292969" />
+<location y=" -0.291016" />
+<location y=" -0.289063" />
+<location y=" -0.287109" />
+<location y=" -0.285156" />
+<location y=" -0.283203" />
+<location y=" -0.281250" />
+<location y=" -0.279297" />
+<location y=" -0.277344" />
+<location y=" -0.275391" />
+<location y=" -0.273438" />
+<location y=" -0.271484" />
+<location y=" -0.269531" />
+<location y=" -0.267578" />
+<location y=" -0.265625" />
+<location y=" -0.263672" />
+<location y=" -0.261719" />
+<location y=" -0.259766" />
+<location y=" -0.257813" />
+<location y=" -0.255859" />
+<location y=" -0.253906" />
+<location y=" -0.251953" />
+<location y=" -0.250000" />
+<location y=" -0.248047" />
+<location y=" -0.246094" />
+<location y=" -0.244141" />
+<location y=" -0.242188" />
+<location y=" -0.240234" />
+<location y=" -0.238281" />
+<location y=" -0.236328" />
+<location y=" -0.234375" />
+<location y=" -0.232422" />
+<location y=" -0.230469" />
+<location y=" -0.228516" />
+<location y=" -0.226563" />
+<location y=" -0.224609" />
+<location y=" -0.222656" />
+<location y=" -0.220703" />
+<location y=" -0.218750" />
+<location y=" -0.216797" />
+<location y=" -0.214844" />
+<location y=" -0.212891" />
+<location y=" -0.210938" />
+<location y=" -0.208984" />
+<location y=" -0.207031" />
+<location y=" -0.205078" />
+<location y=" -0.203125" />
+<location y=" -0.201172" />
+<location y=" -0.199219" />
+<location y=" -0.197266" />
+<location y=" -0.195313" />
+<location y=" -0.193359" />
+<location y=" -0.191406" />
+<location y=" -0.189453" />
+<location y=" -0.187500" />
+<location y=" -0.185547" />
+<location y=" -0.183594" />
+<location y=" -0.181641" />
+<location y=" -0.179688" />
+<location y=" -0.177734" />
+<location y=" -0.175781" />
+<location y=" -0.173828" />
+<location y=" -0.171875" />
+<location y=" -0.169922" />
+<location y=" -0.167969" />
+<location y=" -0.166016" />
+<location y=" -0.164063" />
+<location y=" -0.162109" />
+<location y=" -0.160156" />
+<location y=" -0.158203" />
+<location y=" -0.156250" />
+<location y=" -0.154297" />
+<location y=" -0.152344" />
+<location y=" -0.150391" />
+<location y=" -0.148438" />
+<location y=" -0.146484" />
+<location y=" -0.144531" />
+<location y=" -0.142578" />
+<location y=" -0.140625" />
+<location y=" -0.138672" />
+<location y=" -0.136719" />
+<location y=" -0.134766" />
+<location y=" -0.132813" />
+<location y=" -0.130859" />
+<location y=" -0.128906" />
+<location y=" -0.126953" />
+<location y=" -0.125000" />
+<location y=" -0.123047" />
+<location y=" -0.121094" />
+<location y=" -0.119141" />
+<location y=" -0.117188" />
+<location y=" -0.115234" />
+<location y=" -0.113281" />
+<location y=" -0.111328" />
+<location y=" -0.109375" />
+<location y=" -0.107422" />
+<location y=" -0.105469" />
+<location y=" -0.103516" />
+<location y=" -0.101563" />
+<location y=" -0.099609" />
+<location y=" -0.097656" />
+<location y=" -0.095703" />
+<location y=" -0.093750" />
+<location y=" -0.091797" />
+<location y=" -0.089844" />
+<location y=" -0.087891" />
+<location y=" -0.085938" />
+<location y=" -0.083984" />
+<location y=" -0.082031" />
+<location y=" -0.080078" />
+<location y=" -0.078125" />
+<location y=" -0.076172" />
+<location y=" -0.074219" />
+<location y=" -0.072266" />
+<location y=" -0.070313" />
+<location y=" -0.068359" />
+<location y=" -0.066406" />
+<location y=" -0.064453" />
+<location y=" -0.062500" />
+<location y=" -0.060547" />
+<location y=" -0.058594" />
+<location y=" -0.056641" />
+<location y=" -0.054688" />
+<location y=" -0.052734" />
+<location y=" -0.050781" />
+<location y=" -0.048828" />
+<location y=" -0.046875" />
+<location y=" -0.044922" />
+<location y=" -0.042969" />
+<location y=" -0.041016" />
+<location y=" -0.039063" />
+<location y=" -0.037109" />
+<location y=" -0.035156" />
+<location y=" -0.033203" />
+<location y=" -0.031250" />
+<location y=" -0.029297" />
+<location y=" -0.027344" />
+<location y=" -0.025391" />
+<location y=" -0.023438" />
+<location y=" -0.021484" />
+<location y=" -0.019531" />
+<location y=" -0.017578" />
+<location y=" -0.015625" />
+<location y=" -0.013672" />
+<location y=" -0.011719" />
+<location y=" -0.009766" />
+<location y=" -0.007812" />
+<location y=" -0.005859" />
+<location y=" -0.003906" />
+<location y=" -0.001953" />
+<location y=" 0.000000" />
+<location y=" 0.001953" />
+<location y=" 0.003906" />
+<location y=" 0.005859" />
+<location y=" 0.007813" />
+<location y=" 0.009766" />
+<location y=" 0.011719" />
+<location y=" 0.013672" />
+<location y=" 0.015625" />
+<location y=" 0.017578" />
+<location y=" 0.019531" />
+<location y=" 0.021484" />
+<location y=" 0.023438" />
+<location y=" 0.025391" />
+<location y=" 0.027344" />
+<location y=" 0.029297" />
+<location y=" 0.031250" />
+<location y=" 0.033203" />
+<location y=" 0.035156" />
+<location y=" 0.037109" />
+<location y=" 0.039063" />
+<location y=" 0.041016" />
+<location y=" 0.042969" />
+<location y=" 0.044922" />
+<location y=" 0.046875" />
+<location y=" 0.048828" />
+<location y=" 0.050781" />
+<location y=" 0.052734" />
+<location y=" 0.054688" />
+<location y=" 0.056641" />
+<location y=" 0.058594" />
+<location y=" 0.060547" />
+<location y=" 0.062500" />
+<location y=" 0.064453" />
+<location y=" 0.066406" />
+<location y=" 0.068359" />
+<location y=" 0.070313" />
+<location y=" 0.072266" />
+<location y=" 0.074219" />
+<location y=" 0.076172" />
+<location y=" 0.078125" />
+<location y=" 0.080078" />
+<location y=" 0.082031" />
+<location y=" 0.083984" />
+<location y=" 0.085938" />
+<location y=" 0.087891" />
+<location y=" 0.089844" />
+<location y=" 0.091797" />
+<location y=" 0.093750" />
+<location y=" 0.095703" />
+<location y=" 0.097656" />
+<location y=" 0.099609" />
+<location y=" 0.101563" />
+<location y=" 0.103516" />
+<location y=" 0.105469" />
+<location y=" 0.107422" />
+<location y=" 0.109375" />
+<location y=" 0.111328" />
+<location y=" 0.113281" />
+<location y=" 0.115234" />
+<location y=" 0.117188" />
+<location y=" 0.119141" />
+<location y=" 0.121094" />
+<location y=" 0.123047" />
+<location y=" 0.125000" />
+<location y=" 0.126953" />
+<location y=" 0.128906" />
+<location y=" 0.130859" />
+<location y=" 0.132813" />
+<location y=" 0.134766" />
+<location y=" 0.136719" />
+<location y=" 0.138672" />
+<location y=" 0.140625" />
+<location y=" 0.142578" />
+<location y=" 0.144531" />
+<location y=" 0.146484" />
+<location y=" 0.148438" />
+<location y=" 0.150391" />
+<location y=" 0.152344" />
+<location y=" 0.154297" />
+<location y=" 0.156250" />
+<location y=" 0.158203" />
+<location y=" 0.160156" />
+<location y=" 0.162109" />
+<location y=" 0.164063" />
+<location y=" 0.166016" />
+<location y=" 0.167969" />
+<location y=" 0.169922" />
+<location y=" 0.171875" />
+<location y=" 0.173828" />
+<location y=" 0.175781" />
+<location y=" 0.177734" />
+<location y=" 0.179688" />
+<location y=" 0.181641" />
+<location y=" 0.183594" />
+<location y=" 0.185547" />
+<location y=" 0.187500" />
+<location y=" 0.189453" />
+<location y=" 0.191406" />
+<location y=" 0.193359" />
+<location y=" 0.195313" />
+<location y=" 0.197266" />
+<location y=" 0.199219" />
+<location y=" 0.201172" />
+<location y=" 0.203125" />
+<location y=" 0.205078" />
+<location y=" 0.207031" />
+<location y=" 0.208984" />
+<location y=" 0.210938" />
+<location y=" 0.212891" />
+<location y=" 0.214844" />
+<location y=" 0.216797" />
+<location y=" 0.218750" />
+<location y=" 0.220703" />
+<location y=" 0.222656" />
+<location y=" 0.224609" />
+<location y=" 0.226563" />
+<location y=" 0.228516" />
+<location y=" 0.230469" />
+<location y=" 0.232422" />
+<location y=" 0.234375" />
+<location y=" 0.236328" />
+<location y=" 0.238281" />
+<location y=" 0.240234" />
+<location y=" 0.242188" />
+<location y=" 0.244141" />
+<location y=" 0.246094" />
+<location y=" 0.248047" />
+<location y=" 0.250000" />
+<location y=" 0.251953" />
+<location y=" 0.253906" />
+<location y=" 0.255859" />
+<location y=" 0.257813" />
+<location y=" 0.259766" />
+<location y=" 0.261719" />
+<location y=" 0.263672" />
+<location y=" 0.265625" />
+<location y=" 0.267578" />
+<location y=" 0.269531" />
+<location y=" 0.271484" />
+<location y=" 0.273438" />
+<location y=" 0.275391" />
+<location y=" 0.277344" />
+<location y=" 0.279297" />
+<location y=" 0.281250" />
+<location y=" 0.283203" />
+<location y=" 0.285156" />
+<location y=" 0.287109" />
+<location y=" 0.289063" />
+<location y=" 0.291016" />
+<location y=" 0.292969" />
+<location y=" 0.294922" />
+<location y=" 0.296875" />
+<location y=" 0.298828" />
+<location y=" 0.300781" />
+<location y=" 0.302734" />
+<location y=" 0.304688" />
+<location y=" 0.306641" />
+<location y=" 0.308594" />
+<location y=" 0.310547" />
+<location y=" 0.312500" />
+<location y=" 0.314453" />
+<location y=" 0.316406" />
+<location y=" 0.318359" />
+<location y=" 0.320313" />
+<location y=" 0.322266" />
+<location y=" 0.324219" />
+<location y=" 0.326172" />
+<location y=" 0.328125" />
+<location y=" 0.330078" />
+<location y=" 0.332031" />
+<location y=" 0.333984" />
+<location y=" 0.335938" />
+<location y=" 0.337891" />
+<location y=" 0.339844" />
+<location y=" 0.341797" />
+<location y=" 0.343750" />
+<location y=" 0.345703" />
+<location y=" 0.347656" />
+<location y=" 0.349609" />
+<location y=" 0.351563" />
+<location y=" 0.353516" />
+<location y=" 0.355469" />
+<location y=" 0.357422" />
+<location y=" 0.359375" />
+<location y=" 0.361328" />
+<location y=" 0.363281" />
+<location y=" 0.365234" />
+<location y=" 0.367188" />
+<location y=" 0.369141" />
+<location y=" 0.371094" />
+<location y=" 0.373047" />
+<location y=" 0.375000" />
+<location y=" 0.376953" />
+<location y=" 0.378906" />
+<location y=" 0.380859" />
+<location y=" 0.382813" />
+<location y=" 0.384766" />
+<location y=" 0.386719" />
+<location y=" 0.388672" />
+<location y=" 0.390625" />
+<location y=" 0.392578" />
+<location y=" 0.394531" />
+<location y=" 0.396484" />
+<location y=" 0.398438" />
+<location y=" 0.400391" />
+<location y=" 0.402344" />
+<location y=" 0.404297" />
+<location y=" 0.406250" />
+<location y=" 0.408203" />
+<location y=" 0.410156" />
+<location y=" 0.412109" />
+<location y=" 0.414063" />
+<location y=" 0.416016" />
+<location y=" 0.417969" />
+<location y=" 0.419922" />
+<location y=" 0.421875" />
+<location y=" 0.423828" />
+<location y=" 0.425781" />
+<location y=" 0.427734" />
+<location y=" 0.429688" />
+<location y=" 0.431641" />
+<location y=" 0.433594" />
+<location y=" 0.435547" />
+<location y=" 0.437500" />
+<location y=" 0.439453" />
+<location y=" 0.441406" />
+<location y=" 0.443359" />
+<location y=" 0.445313" />
+<location y=" 0.447266" />
+<location y=" 0.449219" />
+<location y=" 0.451172" />
+<location y=" 0.453125" />
+<location y=" 0.455078" />
+<location y=" 0.457031" />
+<location y=" 0.458984" />
+<location y=" 0.460938" />
+<location y=" 0.462891" />
+<location y=" 0.464844" />
+<location y=" 0.466797" />
+<location y=" 0.468750" />
+<location y=" 0.470703" />
+<location y=" 0.472656" />
+<location y=" 0.474609" />
+<location y=" 0.476563" />
+<location y=" 0.478516" />
+<location y=" 0.480469" />
+<location y=" 0.482422" />
+<location y=" 0.484375" />
+<location y=" 0.486328" />
+<location y=" 0.488281" />
+<location y=" 0.490234" />
+<location y=" 0.492188" />
+<location y=" 0.494141" />
+<location y=" 0.496094" />
+<location y=" 0.498047" />
+<location y=" 0.500000" />
+ </component>
+ </type>
+
+ <type name="monitor" is="monitor">
+  <properties/>
+  <cylinder id="some-shape">
+ <centre-of-bottom-base r="0.0" t="0.0" p="0.0" />
+ <axis x="0.0" y="0.0" z="1.0" />
+ <radius val="0.01" />
+ <height val="0.03" />
+ </cylinder>
+ <algebra val="some-shape" />
+ </type>
+  
+ <type name="pixel" is="detector">
+ <cylinder id="cyl-approx">
+   <centre-of-bottom-base r="0.0" t="0.0" p="0.0" />
+   <axis x="0.0" y="0.2" z="0.0" />
+   <radius val="0.0127" />
+  <height val="   0.002" />
+ </cylinder>
+ <algebra val="cyl-approx" />
+  </type>
+
+
+
+<!-- MONITOR ID LISTS -->
+   <idlist idname="monitors">
+     <id start="1" end="3" />
+   </idlist>
+ <!-- DETECTOR ID LISTS -->
+  <idlist idname="ALFdetectors">
+   <id start="3103000" end="3103511" />
+   <id start="3105000" end="3105511" />
+   <id start="3109000" end="3109511" />
+   <id start="3111000" end="3111511" />
+   <id start="3113000" end="3113511" />
+   <id start="3115000" end="3115511" />
+   <id start="3119000" end="3119511" />
+   <id start="3121000" end="3121511" />
+   <id start="3203000" end="3203511" />
+   <id start="3205000" end="3205511" />
+   <id start="3209000" end="3209511" />
+   <id start="3211000" end="3211511" />
+   <id start="3213000" end="3213511" />
+   <id start="3215000" end="3215511" />
+   <id start="3219000" end="3219511" />
+   <id start="3221000" end="3221511" />
+   <id start="3303000" end="3303511" />
+   <id start="3305000" end="3305511" />
+   <id start="3309000" end="3309511" />
+   <id start="3311000" end="3311511" />
+   <id start="3313000" end="3313511" />
+   <id start="3315000" end="3315511" />
+   <id start="3319000" end="3319511" />
+   <id start="3321000" end="3321511" />
+   </idlist>
+
+<!--  <idlist idname="ALFpack1">
+   <id start="1" end="256" />
+   <id start="257" end="512" />
+   <id start="513" end="768" />
+   <id start="769" end="1024" />
+   <id start="1025" end="1280" />
+   <id start="1281" end="1536" />
+   <id start="1537" end="1792" />
+   <id start="1793" end="2048" />
+   </idlist>
+  <idlist idname="ALFpack2">
+   <id start="2049" end="2304" />
+   <id start="2305" end="2560" />
+   <id start="2561" end="2816" />
+   <id start="2817" end="3072" />
+   <id start="3073" end="3328" />
+   <id start="3329" end="3584" />
+   <id start="3585" end="3840" />
+   <id start="3841" end="4096" />
+   </idlist>
+  <idlist idname="ALFpack3">
+   <id start="4097" end="4352" />
+   <id start="4353" end="4608" />
+   <id start="4609" end="4864" />
+   <id start="4865" end="5120" />
+   <id start="5121" end="5376" />
+   <id start="5377" end="5632" />
+   <id start="5633" end="5888" />
+   <id start="5889" end="6144" />
+   </idlist> -->
+<!--
+  <idlist idname="ALFextratube1">
+   <id start="6145" end="6400" />
+   </idlist>
+  <idlist idname="ALFextratube2">
+   <id start="6401" end="6656" />
+   </idlist>
+-->
+</instrument>
diff --git a/Code/Mantid/instrument/DNS_Definition_PAonly.xml b/Code/Mantid/instrument/DNS_Definition_PAonly.xml
new file mode 100644
index 0000000000000000000000000000000000000000..b9949f4781afadaf90bf51091f12d43616b2b0cd
--- /dev/null
+++ b/Code/Mantid/instrument/DNS_Definition_PAonly.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- For help on the notation used to specify an Instrument Definition File see http://www.mantidproject.org/IDF -->
+<instrument name="DNS" valid-from="1900-01-31 23:59:59" valid-to="2100-01-31 23:59:59" last-modified="2015-03-25 10:17:17">
+  <!-- Author: m.ganeva@fz-juelich.de -->
+  <defaults>
+    <length unit="meter" />
+    <angle unit="degree" />
+    <reference-frame>
+      <!-- The z-axis is set parallel to and in the direction of the beam. the 
+             y-axis points up and the coordinate system is right handed. -->
+      <along-beam axis="z" />
+      <pointing-up axis="y" />
+      <handedness val="right" />
+    </reference-frame>
+  </defaults>
+  <!-- moderator -->
+  <component type="moderator">
+    <location z="-2.27" />
+  </component>
+  <type name="moderator" is="Source"></type>
+  <!-- monitor -->
+  <component type="monitor" idlist="monitor">
+    <location z="-0.229" />
+  </component>
+  <type name="monitor" is="monitor"></type>
+  <idlist idname="monitor">
+    <id val="-1"/>
+  </idlist>
+  <!-- Sample position -->
+  <component type="sample-position">
+    <location y="0.0" x="0.0" z="0.0" />
+  </component>
+  <type name="sample-position" is="SamplePos" />
+  <idlist idname="detectors">
+    <id start="1" end="24" />
+  </idlist>
+  <!-- Detector list def -->
+  <component type="detectors" idlist="detectors">
+    <location />
+  </component>
+  <!-- Detector Banks -->
+  <type name="detectors">
+    <component type="bank0">
+      <location>
+        <parameter name="r-position">
+            <value val="0"/>
+        </parameter>
+        <parameter name="t-position">
+            <logfile id="deterota" eq="0.0+value" extract-single-value-as="first_value"/>
+        </parameter>
+        <parameter name="p-position">
+            <value val="0"/>
+        </parameter>
+        <parameter name="rotx">
+            <value val="0"/>
+        </parameter>
+        <parameter name="roty">
+            <logfile id="deterota"  eq="0.0+value" extract-single-value-as="first_value"/>
+        </parameter>
+        <parameter name="rotz">
+            <value val="0"/>
+        </parameter> 
+      </location>
+    </component>
+  </type>
+  <!-- Definition of the PA detector bank (made of 24 tubes) -->
+  <type name="bank0">
+    <component type="standard_tube">
+      <locations r="0.800000" t="0.000000" t-end="-115.0" p="0.0" name="tube_" n-elements="24" />
+    </component>
+  </type>
+  <!-- Definition of standard_tube -->
+  <type name="standard_tube">
+    <component type="standard_pixel">
+      <location y="0.0" />
+    </component>
+  </type>
+  <type name="standard_pixel" is="detector">
+    <cylinder id="shape">
+      <centre-of-bottom-base x="0.0" y="-0.075" z="0.0" />
+      <axis x="0.0" y="1.0" z="0.0" />
+      <radius val="0.0127" />
+      <height val=".15" />
+    </cylinder>
+    <algebra val="shape" />
+  </type>
+</instrument>
diff --git a/Code/Mantid/instrument/Facilities.xml b/Code/Mantid/instrument/Facilities.xml
index 5b7c6c8b41a29ad5343a1cd3314291b9d4703f2c..1213adaf37862f103db1ccae6db21105283eec1a 100644
--- a/Code/Mantid/instrument/Facilities.xml
+++ b/Code/Mantid/instrument/Facilities.xml
@@ -6,7 +6,7 @@
     <archiveSearch plugin="ISISDataSearch" />
   </archive>
   
-  <computeResource name="SCARF@STFC">
+  <computeResource name="SCARF@STFC" JobManagerType="SCARFLSFJobManager">
     <baseURL>https://portal.scarf.rl.ac.uk</baseURL>
   </computeResource>
 
diff --git a/Code/Mantid/instrument/MAPS_Definition.xml b/Code/Mantid/instrument/MAPS_Definition.xml
index 5bef2b032e4eb8cd001902eace891e0d78747a31..5945f1ff1bdb314b8188dd48326e052f114087e9 100644
--- a/Code/Mantid/instrument/MAPS_Definition.xml
+++ b/Code/Mantid/instrument/MAPS_Definition.xml
@@ -6,7 +6,7 @@
             xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 http://schema.mantidproject.org/IDF/1.0/IDFSchema.xsd"
  name="MAPS" valid-from   ="1900-01-31 23:59:59"
                         valid-to     ="2100-01-31 23:59:59"
-		        last-modified="2011-09-30 13:30:00">
+                        last-modified="2015-03-01 13:30:00">
 
   <defaults>
     <length unit="meter"/>
diff --git a/Code/Mantid/instrument/MAPS_Parameters.xml b/Code/Mantid/instrument/MAPS_Parameters.xml
index 0e961f2d2e597dab1ada0b56388b229a47b48e5b..eabd02d8f5eae12c97d3e45520699193ed0e5637 100644
--- a/Code/Mantid/instrument/MAPS_Parameters.xml
+++ b/Code/Mantid/instrument/MAPS_Parameters.xml
@@ -391,7 +391,7 @@
 </parameter>
 
 <!-- The semicolon separated list of possible log names, containing information on crystl rotation.
-     First found log will be used togethere with motor_offset to identify crystal rotation 
+     First found log will be used togethere with motor_offset to identify crystal rotation
      (psi in Horace) -->
 <parameter name="motor_log_names"  type="string">
    <value val="wccr;Rot"/>
diff --git a/Code/Mantid/instrument/MARI_Definition.xml b/Code/Mantid/instrument/MARI_Definition.xml
index ad7332298c5643d768cad43305e34e5e19d997f5..b4e2f79bd9885fc25b5748eda3987589331b13b5 100644
--- a/Code/Mantid/instrument/MARI_Definition.xml
+++ b/Code/Mantid/instrument/MARI_Definition.xml
@@ -6,7 +6,7 @@
             xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 http://schema.mantidproject.org/IDF/1.0/IDFSchema.xsd"
  name="MARI" valid-from   ="1900-01-31 23:59:59"
                         valid-to     ="2100-01-31 23:59:59"
-		        last-modified="2009-09-15 00:00:00">
+                        last-modified="2015-03-01 00:00:00">
 
   <defaults>
     <length unit="meter"/>
diff --git a/Code/Mantid/instrument/MERLIN_Definition_after2013_4.xml b/Code/Mantid/instrument/MERLIN_Definition_after2013_4.xml
index c87581b895a84e9531eb4ab767201b35af1b6856..fd69107e5c7fdd2600996cd426f5dfb5fb84af57 100644
--- a/Code/Mantid/instrument/MERLIN_Definition_after2013_4.xml
+++ b/Code/Mantid/instrument/MERLIN_Definition_after2013_4.xml
@@ -6,7 +6,7 @@
             xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 http://schema.mantidproject.org/IDF/1.0/IDFSchema.xsd"
  name="MERLIN" valid-from   ="2014-02-10 00:00:01"
                valid-to     ="2100-01-31 23:59:59"
-		       last-modified="2012-03-19 12:00:05">
+               last-modified="2015-03-01 12:00:05">
 
   <defaults>
     <length unit="meter"/>
@@ -27,7 +27,7 @@
     The data for Merlin was obtained from Robert Bewley.
     
     2012-05-17 - added names to tubes
-	2013-11-14 - use locations tag in tube definitions
+    2013-11-14 - use locations tag in tube definitions
   
   -->
 
diff --git a/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py b/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py
index 6ef761fff5569b7884017216b263f2bce72b93f5..d6e3f5352f0fc883cd33a91e0640b55fa8a3bcc8 100644
--- a/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py
+++ b/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py
@@ -342,7 +342,9 @@ class DirectEnergyConversion(object):
         # inform user on what parameters have changed from script or gui
         # if monovan present, check if abs_norm_ parameters are set
         self.prop_man.log_changed_values('notice')
-
+        # before trying to process new results, let's remove from memory old results
+        # if any present and they are not needed any more (user have not renamed them)
+        self._clear_old_results()
 
         start_time = time.time()
 
@@ -420,7 +422,9 @@ class DirectEnergyConversion(object):
             num_ei_cuts = len(self.incident_energy)
             if self.check_background:
                 # find the count rate seen in the regions of the histograms defined
-                # as the background regions, if the user defined such region
+                # as the background regions, if the user defined such region.
+                # In multirep mode this has to be done here, as workspace
+                # will be cut in chunks and bg regions -- removed
                 ws_base = PropertyManager.sample_run.get_workspace()
                 bkgd_range = self.bkgd_range
                 bkgr_ws = self._find_or_build_bkgr_ws(ws_base,bkgd_range[0],bkgd_range[1])
@@ -430,7 +434,9 @@ class DirectEnergyConversion(object):
         else:
             self._multirep_mode = False
             num_ei_cuts = 0
-
+#------------------------------------------------------------------------------------------
+# Main loop over incident energies
+#------------------------------------------------------------------------------------------
         cut_ind = 0 # do not do enumerate if it generates all sequence at once
         #  -- code below uses current energy state from PropertyManager.incident_energy
         for ei_guess in PropertyManager.incident_energy:
@@ -475,6 +481,7 @@ class DirectEnergyConversion(object):
             if out_ws_name:
                 if self._multirep_mode:
                     result.append(deltaE_ws_sample)
+                    self._old_runs_list.append(deltaE_ws_sample.name())
                 else:
                     results_name = deltaE_ws_sample.name()
                     if results_name != out_ws_name:
@@ -483,6 +490,9 @@ class DirectEnergyConversion(object):
             else: # delete workspace if no output is requested
                 self.sample_run = None
         #end_for
+#------------------------------------------------------------------------------------------
+# END Main loop over incident energies
+#------------------------------------------------------------------------------------------
 
         end_time = time.time()
         prop_man.log("*** Elapsed time = {0} sec".format(end_time - start_time),'notice')
@@ -838,13 +848,16 @@ class DirectEnergyConversion(object):
            workspace = PropertyManager.sample_run.get_workspace()
 
         spectra_id = self.prop_man.multirep_tof_specta_list
-        if not spectra_id:
+        if not spectra_id or len(spectra_id) == 0:
+            self.prop_man.log("*** WARNING! no multirep spectra found in IDF! using first existing spectra number\n"\
+                              "             This is wrong unless sample-detector distances of the instrument are all equal.",\
+                              'warning')
             spectra_id = [1]
 
         eMin,dE,eMax = PropertyManager.energy_bins.get_abs_range(self.prop_man)
         ei = PropertyManager.incident_energy.get_current()
         en_list = [eMin,eMin + dE,eMax - dE,eMax]
-        TOF_range = DirectEnergyConversion.get_TOF_for_energies(workspace,en_list,spectra_id,ei)
+        TOF_range = self.get_TOF_for_energies(workspace,en_list,spectra_id,ei)
 
 
         def process_block(tof_range):
@@ -867,15 +880,16 @@ class DirectEnergyConversion(object):
         else:
                tof_min,t_step,tof_max = process_block(TOF_range)
         #end
-        return (tof_min,t_step,tof_max)
+        # add 5% for detectors specified in Par file are shifted a bit and not min-max det any more
+        return (0.95*tof_min,t_step,1.05*tof_max)
+        #return (tof_min,t_step,tof_max)
     #
-    @staticmethod
-    def get_TOF_for_energies(workspace,energy_list,specID_list,ei=None,debug_mode=False):
+    def get_TOF_for_energies(self,workspace,energy_list,specID_list,ei=None,debug_mode=False):
         """ Method to find what TOF range corresponds to given energy range
            for given workspace and detectors.
 
            Input:
-           workspace    pointer to workspace with instrument attached.
+           workspace    handler for the workspace with instrument attached.
            energy_list  the list of input energies to process
            detID_list   list of detectors to find
            ei           incident energy. If present, TOF range is calculated in direct mode,
@@ -884,6 +898,37 @@ class DirectEnergyConversion(object):
            Returns:
            list of TOF corresponding to input energies list.
         """
+        if ei:
+            ei_guess = PropertyManager.incident_energy.get_current()
+            fix_ei = self.fix_ei
+            ei_mon_spectra = self.ei_mon_spectra
+            monitor_ws = PropertyManager.sample_run.get_monitors_ws(ei_mon_spectra,workspace)
+            if monitor_ws is None: # no shifting to monitor position
+                src_name = None
+                mon1_peak = 0
+            else:
+                mon_2_spec_ID = int(ei_mon_spectra[0])
+                # Calculate the incident energy and TOF when the particles access Monitor1
+                try:
+                    ei,mon1_peak,mon1_index,tzero = \
+                    GetEi(InputWorkspace=monitor_ws, Monitor1Spec=mon_2_spec_ID,
+                        Monitor2Spec=int(ei_mon_spectra[1]),
+                        EnergyEstimate=ei_guess,FixEi=fix_ei)
+                    mon1_det = monitor_ws.getDetector(mon1_index)
+                    mon1_pos = mon1_det.getPos()
+                    src_name = monitor_ws.getInstrument().getSource().getName()
+                except :
+                    src_name = None
+                    mon1_peak = 0
+                    en_bin  = [energy_list[0],energy_list[1]-energy_list[0],energy_list[3]]
+                    self.prop_man.log("*** WARNING: message from multirep chunking procedure: get_TOF_for_energies:\n"\
+                                      "    not able to identify energy peak looking for TOF range for incident energy: {0}meV, binning: {1}\n"\
+                                      "    Continuing under assumption that incident neutrons arrive at source at time=0".\
+                                       format(ei_guess,en_bin),'warning')
+        else:
+            mon1_peak = 0
+        #end if
+
         template_ws_name = '_energy_range_ws'
         range_ws_name = '_TOF_range_ws'
         y = [1] * (len(energy_list) - 1)
@@ -893,11 +938,14 @@ class DirectEnergyConversion(object):
             ExtractSingleSpectrum(InputWorkspace=workspace, OutputWorkspace=template_ws_name, WorkspaceIndex=ind)
             if ei:
                 CreateWorkspace(OutputWorkspace=range_ws_name,NSpec = 1,DataX=energy_list,DataY=y,UnitX='DeltaE',ParentWorkspace=template_ws_name)
+                if src_name:
+                    MoveInstrumentComponent(Workspace=range_ws_name,ComponentName= src_name, X=mon1_pos.getX(),
+                                        Y=mon1_pos.getY(), Z=mon1_pos.getZ(), RelativePosition=False)
                 range_ws = ConvertUnits(InputWorkspace=range_ws_name,OutputWorkspace=range_ws_name,Target='TOF',EMode='Direct',EFixed=ei)
             else:
                 CreateWorkspace(OutputWorkspace=range_ws_name,NSpec = 1,DataX=energy_list,DataY=y,UnitX='Energy',ParentWorkspace=template_ws_name)
                 range_ws = ConvertUnits(InputWorkspace=range_ws_name,OutputWorkspace=range_ws_name,Target='TOF',EMode='Elastic')
-            x = range_ws.dataX(0)
+            x = range_ws.dataX(0)+mon1_peak
             TOF_range.append(x.tolist())
 
         if not debug_mode:
@@ -1224,11 +1272,15 @@ class DirectEnergyConversion(object):
         # workspace
         # processed
         object.__setattr__(self,'_multirep_mode',False)
+        # list of workspace names, processed earlier
+        object.__setattr__(self,'_old_runs_list',[])
+
 
         all_methods = dir(self)
         # define list of all existing properties, which have descriptors
         object.__setattr__(self,'_descriptors',extract_non_system_names(all_methods))
 
+
         if instr_name:
             self.initialise(instr_name,reload_instrument)
         #end
@@ -1468,7 +1520,7 @@ class DirectEnergyConversion(object):
 #-------------------------------------------------------------------------------
     def _get_wb_inegrals(self,run):
         """Obtain white bean vanadium integrals either by integrating
-           workspace in question or cashed value
+           workspace in question or using cashed value
         """
         run = self.get_run_descriptor(run)
         white_ws = run.get_workspace()
@@ -1531,7 +1583,15 @@ class DirectEnergyConversion(object):
         low,upp = self.wb_integr_range
         white_tag = 'NormBy:{0}_IntergatedIn:{1:0>10.2f}:{2:0>10.2f}'.format(self.normalise_method,low,upp)
         return white_tag
-
+    #
+    def _clear_old_results(self):
+        """Remove workspaces, processed earlier and not used any more"""
+        ws_list = self._old_runs_list
+        for ws_name in ws_list:
+            if ws_name in mtd:
+                DeleteWorkspace(ws_name)
+        object.__setattr__(self,'_old_runs_list',[])
+    #
 def get_failed_spectra_list_from_masks(masked_wksp,prop_man):
     """Compile a list of spectra numbers that are marked as
        masked in the masking workspace
diff --git a/Code/Mantid/scripts/Inelastic/Direct/PropertyManager.py b/Code/Mantid/scripts/Inelastic/Direct/PropertyManager.py
index 5b72a5818980f75fe98d670543dba492716166fc..435d98eb403f96512989dba358aaa5e79a823756 100644
--- a/Code/Mantid/scripts/Inelastic/Direct/PropertyManager.py
+++ b/Code/Mantid/scripts/Inelastic/Direct/PropertyManager.py
@@ -584,7 +584,7 @@ class PropertyManager(NonIDF_Properties):
 
         ok,mess= self._check_ouptut_dir()
         if not ok:
-            mess = '*** WARNING: saving results: --> {1}'.format(mess)
+            mess = '*** WARNING: saving results: --> {0}'.format(mess)
 
             if fail_on_errors:
                 self.log(mess,'warning')
diff --git a/Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py b/Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py
index d3c7ff4af87cffceee1b2c09d1c0600a96edd8b2..35a7e72238653e60840eb37a4c6e756924cbcfcf 100644
--- a/Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py
+++ b/Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py
@@ -338,11 +338,17 @@ class ReductionWrapper(object):
                 nruns = len(runfiles)
                 for num,file in enumerate(runfiles):
                     red_ws = self.reduce(file)
-                    if nruns > 1:
-                        out_name = out_ws_name + '#{0}of{1}'.format(num + 1,nruns)
-                        RenameWorkspace(InputWorkspace=red_ws,OutputWorkspace=out_name)
-                        red_ws = mtd[out_name]
-                    results.append(red_ws)
+                    if isinstance(red_ws,list):
+                        for ws in red_ws:
+                            results.append(ws)
+                    else:
+                        if nruns == 1:
+                            RenameWorkspace(InputWorkspace=red_ws,OutputWorkspace=out_ws_name)
+                            results.append(mtd[out_ws_name])
+                        else:
+                            OutWSName = '{0}#{1}of{2}'.format(out_ws_name,num+1,nruns)
+                            RenameWorkspace(InputWorkspace=red_ws,OutputWorkspace=OutWSName)
+                            results.append(mtd[OutWSName])
                 #end
                 if len(results) == 1:
                     return results[0]
diff --git a/Code/Mantid/scripts/Inelastic/Direct/RunDescriptor.py b/Code/Mantid/scripts/Inelastic/Direct/RunDescriptor.py
index 7e567c8e95e7b97629e0b522c665e0859b3906c5..a146d0a0c99de03dd1258a4409e8cb2b2c158b70 100644
--- a/Code/Mantid/scripts/Inelastic/Direct/RunDescriptor.py
+++ b/Code/Mantid/scripts/Inelastic/Direct/RunDescriptor.py
@@ -455,7 +455,10 @@ class RunDescriptor(PropDescriptor):
             self._run_list.set_last_ind2sum(ind)
             self._run_number = run_num
             self._run_file_path = file_path
-            self._fext = main_fext
+            if fext is None:
+                self._fext = None
+            else:
+                self._fext = main_fext
             self._ws_name = self._build_ws_name()
 
     def run_number(self):
@@ -775,13 +778,16 @@ class RunDescriptor(PropDescriptor):
             return origin
 
 #--------------------------------------------------------------------------------------------------------------------
-    def get_monitors_ws(self,monitor_ID=None):
+    def get_monitors_ws(self,monitors_ID=None,otherWS=None):
         """Get pointer to a workspace containing monitors.
 
            Explores different ways of finding monitor workspace in Mantid and returns the python pointer to the
            workspace which contains monitors.
         """
-        data_ws = self.get_workspace()
+        if otherWS:
+            data_ws  = otherWS
+        else:
+            data_ws = self.get_workspace()
         if not data_ws:
             return None
 
@@ -798,25 +804,26 @@ class RunDescriptor(PropDescriptor):
             for specID in spec_to_mon:
                 mon_ws = self.copy_spectrum2monitors(data_ws,mon_ws,specID)
 
-        if monitor_ID:
-            try:
-                ws_index = mon_ws.getIndexFromSpectrumNumber(monitor_ID)
-            except: #
-                mon_ws = None
+        if monitors_ID:
+            if isinstance(monitors_ID,list):
+                mon_list = monitors_ID
+            else:
+                mon_list = [monitors_ID]
         else:
             mon_list = self._holder.get_used_monitors_list()
-            for monID in mon_list:
+        #
+        for monID in mon_list:
+            try:
+                ws_ind = mon_ws.getIndexFromSpectrumNumber(int(monID))
+            except:
                 try:
-                    ws_ind = mon_ws.getIndexFromSpectrumNumber(int(monID))
-                except:
-                    try:
-                        monws_name = mon_ws.name()
-                    except: 
-                        monws_name = 'None'
-                    RunDescriptor._logger('*** Monitor workspace {0} does not have monitor with ID {1}. Monitor workspace set to None'.\
+                    monws_name = mon_ws.name()
+                except: 
+                    monws_name = 'None'
+                RunDescriptor._logger('*** Monitor workspace {0} does not have monitor with ID {1}. Monitor workspace set to None'.\
                                           format(monws_name,monID),'warning')
-                    mon_ws = None
-                    break
+                mon_ws = None
+                break
         return mon_ws
 #--------------------------------------------------------------------------------------------------------------------
     def is_existing_ws(self):
diff --git a/Code/Mantid/scripts/Inelastic/IndirectAbsCor.py b/Code/Mantid/scripts/Inelastic/IndirectAbsCor.py
index bd2855548e4a6196cb2d27547ab29e7d28284c34..3f7b40f777eb10a18243316b4de8b0d6d37bb77c 100644
--- a/Code/Mantid/scripts/Inelastic/IndirectAbsCor.py
+++ b/Code/Mantid/scripts/Inelastic/IndirectAbsCor.py
@@ -193,25 +193,28 @@ def AbsRun(inputWS, geom, beam, ncan, size, density, sigs, siga, avar, Save):
     accWS = name + '_acc'
     fname = name + '_abs'
 
+    log_names = [item[0] for item in sample_logs]
+    log_values = [item[1] for item in sample_logs]
+
     CreateWorkspace(OutputWorkspace=assWS, DataX=dataX, DataY=dataA1,
                     NSpec=ndet, UnitX='Wavelength',
                     VerticalAxisUnit=v_axis_unit, VerticalAxisValues=v_axis_values)
-    addSampleLogs(assWS, sample_logs)
+    AddSampleLogMultiple(Workspace=assWS, LogNames=log_names, LogValues=log_values)
 
     CreateWorkspace(OutputWorkspace=asscWS, DataX=dataX, DataY=dataA2,
                     NSpec=ndet, UnitX='Wavelength',
                     VerticalAxisUnit=v_axis_unit, VerticalAxisValues=v_axis_values)
-    addSampleLogs(asscWS, sample_logs)
+    AddSampleLogMultiple(Workspace=asscWS, LogNames=log_names, LogValues=log_values)
 
     CreateWorkspace(OutputWorkspace=acscWS, DataX=dataX, DataY=dataA3,
                     NSpec=ndet, UnitX='Wavelength',
                     VerticalAxisUnit=v_axis_unit, VerticalAxisValues=v_axis_values)
-    addSampleLogs(acscWS, sample_logs)
+    AddSampleLogMultiple(Workspace=acscWS, LogNames=log_names, LogValues=log_values)
 
     CreateWorkspace(OutputWorkspace=accWS, DataX=dataX, DataY=dataA4,
                     NSpec=ndet, UnitX='Wavelength',
                     VerticalAxisUnit=v_axis_unit, VerticalAxisValues=v_axis_values)
-    addSampleLogs(accWS, sample_logs)
+    AddSampleLogMultiple(Workspace=accWS, LogNames=log_names, LogValues=log_values)
 
     group = assWS + ',' + asscWS + ',' + acscWS + ',' + accWS
     GroupWorkspaces(InputWorkspaces=group, OutputWorkspace=fname)
diff --git a/Code/Mantid/scripts/Inelastic/IndirectCommon.py b/Code/Mantid/scripts/Inelastic/IndirectCommon.py
index 7804beeac9c0d789bfdf57db35304691f364d11c..b96219f3b30d0ad6eb8f76acbf3fcef637b0db26 100644
--- a/Code/Mantid/scripts/Inelastic/IndirectCommon.py
+++ b/Code/Mantid/scripts/Inelastic/IndirectCommon.py
@@ -545,23 +545,3 @@ def convertParametersToWorkspace(params_table, x_column, param_names, output_nam
         axis.setLabel(i, name)
     mtd[output_name].replaceAxis(1, axis)
 
-
-def addSampleLogs(ws, sample_logs):
-    """
-    Add a dictionary of logs to a workspace.
-
-    The type of the log is inferred by the type of the value passed to the log.
-
-    @param ws - workspace to add logs too.
-    @param sample_logs - dictionary of logs to append to the workspace.
-    """
-
-    for key, value in sample_logs.iteritems():
-        if isinstance(value, bool):
-            log_type = 'String'
-        elif isinstance(value, (int, long, float)):
-            log_type = 'Number'
-        else:
-            log_type = 'String'
-
-        AddSampleLog(Workspace=ws, LogName=key, LogType=log_type, LogText=str(value))
diff --git a/Code/Mantid/scripts/Inelastic/IndirectDataAnalysis.py b/Code/Mantid/scripts/Inelastic/IndirectDataAnalysis.py
index 54e34ca44457893d7b7090a436bc0127c658a5c8..c258965efba5ec46a5ac556cd70b6135b829669d 100644
--- a/Code/Mantid/scripts/Inelastic/IndirectDataAnalysis.py
+++ b/Code/Mantid/scripts/Inelastic/IndirectDataAnalysis.py
@@ -98,26 +98,28 @@ def confitSeq(inputWS, func, startX, endX, ftype, bgd, temperature=None, specMin
     axis = mtd[wsname].getAxis(0)
     axis.setUnit("MomentumTransfer")
 
+    # Handle sample logs
+    temp_correction = temperature is not None
+
     CopyLogs(InputWorkspace=inputWS, OutputWorkspace=wsname)
-    AddSampleLog(Workspace=wsname, LogName='convolve_members',
-                 LogType='String', LogText=str(convolve))
-    AddSampleLog(Workspace=wsname, LogName="fit_program",
-                 LogType="String", LogText='ConvFit')
-    AddSampleLog(Workspace=wsname, LogName='background',
-                 LogType='String', LogText=str(bgd))
-    AddSampleLog(Workspace=wsname, LogName='delta_function',
-                 LogType='String', LogText=str(using_delta_func))
-    AddSampleLog(Workspace=wsname, LogName='lorentzians',
-                 LogType='String', LogText=str(lorentzians))
 
-    CopyLogs(InputWorkspace=wsname, OutputWorkspace=output_workspace + "_Workspaces")
+    sample_logs = [('convolve_members', convolve),
+                   ('fit_program', 'ConvFit'),
+                   ('background', bgd),
+                   ('delta_function', using_delta_func),
+                   ('lorentzians', lorentzians),
+                   ('temperature_correction', temp_correction)]
 
-    temp_correction = temperature is not None
-    AddSampleLog(Workspace=wsname, LogName='temperature_correction',
-                 LogType='String', LogText=str(temp_correction))
     if temp_correction:
-        AddSampleLog(Workspace=wsname, LogName='temperature_value',
-                     LogType='String', LogText=str(temperature))
+        sample_logs.append(('temperature_value', temperature))
+
+    log_names = [log[0] for log in sample_logs]
+    log_values = [log[1] for log in sample_logs]
+    AddSampleLogMultiple(Workspace=wsname,
+                         LogNames=log_names,
+                         LogValues=log_values)
+
+    CopyLogs(InputWorkspace=wsname, OutputWorkspace=output_workspace + "_Workspaces")
 
     RenameWorkspace(InputWorkspace=output_workspace,
                     OutputWorkspace=output_workspace + "_Parameters")
@@ -200,8 +202,10 @@ def furyfitSeq(inputWS, func, ftype, startx, endx, spec_min=0, spec_max=None, in
     CopyLogs(InputWorkspace=inputWS, OutputWorkspace=fit_group)
     CopyLogs(InputWorkspace=inputWS, OutputWorkspace=result_workspace)
 
-    addSampleLogs(fit_group, sample_logs)
-    addSampleLogs(result_workspace, sample_logs)
+    log_names = [item[0] for item in sample_logs]
+    log_values = [item[1] for item in sample_logs]
+    AddSampleLogMultiple(Workspace=result_workspace, LogNames=log_names, LogValues=log_values)
+    AddSampleLogMultiple(Workspace=fit_group, LogNames=log_names, LogValues=log_values)
 
     if Save:
         save_workspaces = [result_workspace, fit_group]
@@ -270,8 +274,10 @@ def furyfitMult(inputWS, function, ftype, startx, endx, spec_min=0, spec_max=Non
     CopyLogs(InputWorkspace=inputWS, OutputWorkspace=result_workspace)
     CopyLogs(InputWorkspace=inputWS, OutputWorkspace=fit_group)
 
-    addSampleLogs(result_workspace, sample_logs)
-    addSampleLogs(fit_group, sample_logs)
+    log_names = [item[0] for item in sample_logs]
+    log_values = [item[1] for item in sample_logs]
+    AddSampleLogMultiple(Workspace=result_workspace, LogNames=log_names, LogValues=log_values)
+    AddSampleLogMultiple(Workspace=fit_group, LogNames=log_names, LogValues=log_values)
 
     DeleteWorkspace(tmp_fit_workspace)
 
diff --git a/Code/Mantid/scripts/SCD_Reduction/ReduceSCD.config b/Code/Mantid/scripts/SCD_Reduction/ReduceSCD.config
index 67b5014828afe4eb8502b3a4816760b39390420c..324b3883589caf24d49f3ea2b12b0f784a38cdd6 100644
--- a/Code/Mantid/scripts/SCD_Reduction/ReduceSCD.config
+++ b/Code/Mantid/scripts/SCD_Reduction/ReduceSCD.config
@@ -43,6 +43,8 @@ calibration_file_2  None
 #
 data_directory    None       
 output_directory  /SNS/TOPAZ/IPTS-9890/shared/SPAnH
+# Change to true for data with lots of peaks.  Use False for ISAW ASCII output
+output_nexus      False
 
 #
 # If use_monitor_counts is True, then the integrated beam monitor
diff --git a/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_OneRun.py b/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_OneRun.py
index da992481ba3ac2c36cd0634d9073a5a3f2989c71..8ae81127207be15b6d7bff3d4f079f5d9f55bd07 100644
--- a/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_OneRun.py
+++ b/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_OneRun.py
@@ -72,6 +72,7 @@ calibration_file_1        = params_dictionary.get('calibration_file_1', None)
 calibration_file_2        = params_dictionary.get('calibration_file_2', None)
 data_directory            = params_dictionary[ "data_directory" ]
 output_directory          = params_dictionary[ "output_directory" ]
+output_nexus              = params_dictionary.get( "output_nexus", False)
 min_tof                   = params_dictionary[ "min_tof" ]
 max_tof                   = params_dictionary[ "max_tof" ]
 use_monitor_counts        = params_dictionary[ "use_monitor_counts" ]
@@ -145,7 +146,10 @@ print "\nProcessing File: " + full_name + " ......\n"
 # Name the files to write for this run
 #
 run_niggli_matrix_file = output_directory + "/" + run + "_Niggli.mat"
-run_niggli_integrate_file = output_directory + "/" + run + "_Niggli.integrate"
+if output_nexus:
+    run_niggli_integrate_file = output_directory + "/" + run + "_Niggli.nxs"
+else:
+    run_niggli_integrate_file = output_directory + "/" + run + "_Niggli.integrate"
 
 #
 # Load the run data and find the total monitor counts
@@ -219,7 +223,10 @@ IndexPeaks( PeaksWorkspace=peaks_ws, Tolerance=tolerance)
 # see these partial results
 #
 SaveIsawUB( InputWorkspace=peaks_ws,Filename=run_niggli_matrix_file )
-SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False,
+if output_nexus:
+	SaveNexus( InputWorkspace=peaks_ws, Filename=run_niggli_integrate_file )
+else:
+	SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False,
                Filename=run_niggli_integrate_file )
 
 #
@@ -327,7 +334,10 @@ elif use_cylindrical_integration:
 # This is the only file needed, for the driving script to get a combined
 # result.
 #
-SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False,
+if output_nexus:
+	SaveNexus( InputWorkspace=peaks_ws, Filename=run_niggli_integrate_file )
+else:
+	SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False,
                Filename=run_niggli_integrate_file )
 
 # Print warning if user is trying to integrate using the cylindrical method and transorm the cell
@@ -342,13 +352,20 @@ else:
     if (not cell_type is None) and (not centering is None) :
         run_conventional_matrix_file = output_directory + "/" + run + "_" +        \
                                    cell_type + "_" + centering + ".mat"
-        run_conventional_integrate_file = output_directory + "/" + run + "_" + \
+        if output_nexus:
+            run_conventional_integrate_file = output_directory + "/" + run + "_" + \
+                                      cell_type + "_" + centering + ".nxs"
+        else:
+            run_conventional_integrate_file = output_directory + "/" + run + "_" + \
                                       cell_type + "_" + centering + ".integrate"
         SelectCellOfType( PeaksWorkspace=peaks_ws,\
                       CellType=cell_type, Centering=centering,\
                       AllowPermutations=allow_perm,\
                       Apply=True, Tolerance=tolerance )
-        SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False,\
+	if output_nexus:
+        	SaveNexus( InputWorkspace=peaks_ws, Filename=run_conventional_integrate_file )
+        else:
+        	SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False,\
                    Filename=run_conventional_integrate_file )
         SaveIsawUB( InputWorkspace=peaks_ws, Filename=run_conventional_matrix_file )
 
diff --git a/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_Parallel.py b/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_Parallel.py
index 16a978089c34d4a2f4c1ad37234f8ce01d269a62..804358531b1d668af187c5aedeea8ff4958e5339 100644
--- a/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_Parallel.py
+++ b/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_Parallel.py
@@ -84,6 +84,7 @@ params_dictionary = ReduceDictionary.LoadDictionary( *config_files )
 
 exp_name              = params_dictionary[ "exp_name" ]
 output_directory      = params_dictionary[ "output_directory" ]
+output_nexus          = params_dictionary.get( "output_nexus", False)
 reduce_one_run_script = params_dictionary[ "reduce_one_run_script" ]
 slurm_queue_name      = params_dictionary[ "slurm_queue_name" ]
 max_processes         = int(params_dictionary[ "max_processes" ])
@@ -94,6 +95,7 @@ cell_type             = params_dictionary[ "cell_type" ]
 centering             = params_dictionary[ "centering" ]
 allow_perm            = params_dictionary[ "allow_perm" ]
 run_nums              = params_dictionary[ "run_nums" ]
+data_directory        = params_dictionary[ "data_directory" ]
 
 use_cylindrical_integration = params_dictionary[ "use_cylindrical_integration" ]
 instrument_name       = params_dictionary[ "instrument_name" ]
@@ -153,14 +155,44 @@ print   "***********************************************************************
 # appending them to a combined output file.
 #
 niggli_name = output_directory + "/" + exp_name + "_Niggli"
-niggli_integrate_file = niggli_name + ".integrate"
+if output_nexus:
+    niggli_integrate_file = niggli_name + ".nxs"
+else:
+    niggli_integrate_file = niggli_name + ".integrate"
 niggli_matrix_file = niggli_name + ".mat"
 
 first_time = True
+
+if output_nexus:
+    #Only need this for instrument for peaks_total
+    short_filename = "%s_%s_event.nxs" % (instrument_name, str(run_nums[0]))
+    if data_directory is not None:
+        full_name = data_directory + "/" + short_filename
+    else:
+        candidates = FileFinder.findRuns(short_filename)
+        full_name = ""
+        for item in candidates:
+            if os.path.exists(item):
+                full_name = str(item)
+    
+        if not full_name.endswith('nxs'):
+            print "Exiting since the data_directory was not specified and"
+            print "findnexus failed for event NeXus file: " + instrument_name + " " + str(run)
+            exit(0)
+    #
+    # Load the first data file to find instrument
+    #
+    wksp = LoadEventNexus( Filename=full_name, FilterByTofMin=0, FilterByTofMax=0 )
+    peaks_total = CreatePeaksWorkspace(NumberOfPeaks=0, InstrumentWorkspace=wksp)
+
 if not use_cylindrical_integration:
     for r_num in run_nums:
-        one_run_file = output_directory + '/' + str(r_num) + '_Niggli.integrate'
-        peaks_ws = LoadIsawPeaks( Filename=one_run_file )
+        if output_nexus:
+            one_run_file = output_directory + '/' + str(r_num) + '_Niggli.nxs'
+            peaks_ws = Load( Filename=one_run_file )
+        else:
+            one_run_file = output_directory + '/' + str(r_num) + '_Niggli.integrate'
+            peaks_ws = LoadIsawPeaks( Filename=one_run_file )
         if first_time:
             if UseFirstLattice and not read_UB:
     # Find a UB (using FFT) for the first run to use in the FindUBUsingLatticeParameters
@@ -171,17 +203,27 @@ if not use_cylindrical_integration:
                 uc_alpha = peaks_ws.sample().getOrientedLattice().alpha()
                 uc_beta = peaks_ws.sample().getOrientedLattice().beta()
                 uc_gamma = peaks_ws.sample().getOrientedLattice().gamma()
-            SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=niggli_integrate_file )
-
+		if output_nexus:
+                    peaks_total = CombinePeaksWorkspaces(LHSWorkspace=peaks_total, RHSWorkspace=peaks_ws)
+                    SaveNexus( InputWorkspace=peaks_ws, Filename=niggli_integrate_file )
+		else:
+                    SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=niggli_integrate_file )
             first_time = False
         else:
-            SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=True, Filename=niggli_integrate_file )
+	    if output_nexus:
+                peaks_total = CombinePeaksWorkspaces(LHSWorkspace=peaks_total, RHSWorkspace=peaks_ws)
+                SaveNexus( InputWorkspace=peaks_total, Filename=niggli_integrate_file )
+	    else:
+                SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=True, Filename=niggli_integrate_file )
 
 #
 # Load the combined file and re-index all of the peaks together.
 # Save them back to the combined Niggli file (Or selcted UB file if in use...)
 #
-    peaks_ws = LoadIsawPeaks( Filename=niggli_integrate_file )
+    if output_nexus:
+        peaks_ws = Load( Filename=niggli_integrate_file )
+    else:
+        peaks_ws = LoadIsawPeaks( Filename=niggli_integrate_file )
 
 #
 # Find a Niggli UB matrix that indexes the peaks in this run
@@ -206,7 +248,10 @@ if not use_cylindrical_integration:
         FindUBUsingFFT( PeaksWorkspace=peaks_ws, MinD=min_d, MaxD=max_d, Tolerance=tolerance )
 
     IndexPeaks( PeaksWorkspace=peaks_ws, Tolerance=tolerance )
-    SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=niggli_integrate_file )
+    if output_nexus:
+        SaveNexus( InputWorkspace=peaks_ws, Filename=niggli_integrate_file )
+    else:
+        SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=niggli_integrate_file )
     SaveIsawUB( InputWorkspace=peaks_ws, Filename=niggli_matrix_file )
 
 #
@@ -216,12 +261,18 @@ if not use_cylindrical_integration:
 if not use_cylindrical_integration:
     if (not cell_type is None) and (not centering is None) :
         conv_name = output_directory + "/" + exp_name + "_" + cell_type + "_" + centering
-        conventional_integrate_file = conv_name + ".integrate"
+        if output_nexus:
+            conventional_integrate_file = conv_name + ".nxs"
+        else:
+            conventional_integrate_file = conv_name + ".integrate"
         conventional_matrix_file = conv_name + ".mat"
 
         SelectCellOfType( PeaksWorkspace=peaks_ws, CellType=cell_type, Centering=centering,\
                       AllowPermutations=allow_perm, Apply=True, Tolerance=tolerance )
-        SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=conventional_integrate_file )
+        if output_nexus:
+            SaveNexus( InputWorkspace=peaks_ws, Filename=conventional_integrate_file )
+        else:
+            SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=conventional_integrate_file )
         SaveIsawUB( InputWorkspace=peaks_ws, Filename=conventional_matrix_file )
 
 if use_cylindrical_integration:
diff --git a/Code/Mantid/scripts/test/DirectEnergyConversionTest.py b/Code/Mantid/scripts/test/DirectEnergyConversionTest.py
index e5f988c366f5baf2fd3945c8ebc5022c3b33ae69..c8f735d78d24c63759e8d676865d68bf5dc98691 100644
--- a/Code/Mantid/scripts/test/DirectEnergyConversionTest.py
+++ b/Code/Mantid/scripts/test/DirectEnergyConversionTest.py
@@ -307,23 +307,23 @@ class DirectEnergyConversionTest(unittest.TestCase):
     def test_tof_range(self):
 
         run=CreateSampleWorkspace(Function='Multiple Peaks', NumBanks=6, BankPixelWidth=1, NumEvents=10,\
-                                  XUnit='DeltaE', XMin=-20, XMax=65, BinWidth=0.2)
+                                  XUnit='Energy', XMin=5, XMax=75, BinWidth=0.2)
         LoadInstrument(run,InstrumentName='MARI')
 
         red = DirectEnergyConversion(run.getInstrument())
 
-        red.prop_man.incident_energy = 67
-        red.prop_man.energy_bins =  [-20,0.2,65]
+        red.prop_man.incident_energy = 26.2
+        red.prop_man.energy_bins =  [-20,0.1,20]
         red.prop_man.multirep_tof_specta_list = [4,5,6]
         MoveInstrumentComponent(Workspace='run', ComponentName='Detector', DetectorID=1102, Z=3)
         MoveInstrumentComponent(Workspace='run', ComponentName='Detector', DetectorID=1103,Z=6)
 
+        run_tof = ConvertUnits(run,Target='TOF',EMode='Elastic')
 
-        tof_range = red.find_tof_range_for_multirep(run)
+        tof_range = red.find_tof_range_for_multirep(run_tof)
 
         self.assertEqual(len(tof_range),3)
 
-        run_tof = ConvertUnits(run,Target='TOF',EMode='Direct',EFixed=67.)
         x = run_tof.readX(3)
         dx=abs(x[1:]-x[:-1])
         xMin = min(x)
@@ -332,17 +332,23 @@ class DirectEnergyConversionTest(unittest.TestCase):
         xMax = max(x)
 
 
-        self.assertAlmostEqual(tof_range[0],xMin)
-        self.assertAlmostEqual(tof_range[1],dt)
-        self.assertAlmostEqual(tof_range[2],xMax)
+        self.assertTrue(tof_range[0]>xMin)
+        #self.assertAlmostEqual(tof_range[1],dt)
+        self.assertTrue(tof_range[2]<xMax)
 
         # check another working mode
         red.prop_man.multirep_tof_specta_list = 4
-        tof_range1 = red.find_tof_range_for_multirep(run)
+        red.prop_man.incident_energy = 47.505
+        red.prop_man.energy_bins =  [-20,0.1,45]
+  
+        tof_range1 = red.find_tof_range_for_multirep(run_tof)
 
-        self.assertAlmostEqual(tof_range[0],tof_range1[0])
-        self.assertAlmostEqual(tof_range[1],tof_range1[1])
-        #self.assertAlmostEqual(tof_range[2],tof_range1[2])
+        self.assertTrue(tof_range1[0]>xMin)
+        self.assertTrue(tof_range1[2]<xMax)
+
+        self.assertTrue(tof_range1[2]<tof_range[2])
+        self.assertTrue(tof_range1[0]<tof_range[0])
+        self.assertTrue(tof_range1[1]<tof_range[1])
 
     def test_multirep_mode(self):
         # create test workspace
diff --git a/Code/Mantid/scripts/test/IndirectCommonTests.py b/Code/Mantid/scripts/test/IndirectCommonTests.py
index 48b88d94cdbcfd17c9ca79127b289d06d92d8704..a0bbe462f14254221715448ab0b8b70d7269affa 100644
--- a/Code/Mantid/scripts/test/IndirectCommonTests.py
+++ b/Code/Mantid/scripts/test/IndirectCommonTests.py
@@ -285,23 +285,6 @@ class IndirectCommonTests(unittest.TestCase):
         self.assert_matrix_workspace_dimensions(params_workspace.name(),
                                                 expected_num_histograms=3, expected_blocksize=5)
 
-    def test_addSampleLogs(self):
-        ws = CreateSampleWorkspace()
-        logs = {}
-        logs['FloatLog'] = 3.149
-        logs['IntLog'] = 42
-        logs['StringLog'] = "A String Log"
-        logs['BooleanLog'] = True
-
-        indirect_common.addSampleLogs(ws, logs)
-
-        self.assert_logs_match_expected(ws.name(), logs)
-
-    def test_addSampleLogs_empty_dict(self):
-        ws = CreateSampleWorkspace()
-        logs = {}
-        self.assert_does_not_raise(Exception, indirect_common.addSampleLogs, ws, logs)
-
     #-----------------------------------------------------------
     # Custom assertion functions
     #-----------------------------------------------------------
diff --git a/Code/Mantid/scripts/test/ReductionWrapperTest.py b/Code/Mantid/scripts/test/ReductionWrapperTest.py
index f037da458dd5e8dd5c435dddec07099d8715c3e1..d9ba91438a67778aac58c91a50f32d65456c9a77 100644
--- a/Code/Mantid/scripts/test/ReductionWrapperTest.py
+++ b/Code/Mantid/scripts/test/ReductionWrapperTest.py
@@ -44,7 +44,32 @@ class test_helper(ReductionWrapper):
         #return None
     @iliad
     def reduce(self, input_file = None, output_directory = None):
-        return ''
+
+        self.reducer._clear_old_results()
+        if input_file:
+            self.reducer.prop_man.sample_run = input_file
+        run = self.reducer.prop_man.sample_run
+
+        result = []
+        if PropertyManager.incident_energy.multirep_mode():
+            en_range = self.reducer.prop_man.incident_energy
+            for ind,en in enumerate(en_range):
+                ws=CreateSampleWorkspace()
+                AddSampleLog(ws,LogName = 'run_number',LogText=str(run))
+                PropertyManager.sample_run.set_action_suffix('#{0}_reduced'.format(ind+1))
+                PropertyManager.sample_run.synchronize_ws(ws)
+                result.append(ws)
+                self.reducer._old_runs_list.append(ws.name())
+        else:
+            ws=CreateSampleWorkspace()
+            AddSampleLog(ws,LogName = 'run_number',LogText=str(run))
+            PropertyManager.sample_run.set_action_suffix('_reduced')
+            PropertyManager.sample_run.synchronize_ws(ws)
+            result.append(ws)
+
+        if len(result) == 1:
+            result = result[0]
+        return result
 #-----------------------------------------------------------------------------------------------------------------------------------------
 #-----------------------------------------------------------------------------------------------------------------------------------------
 #-----------------------------------------------------------------------------------------------------------------------------------------
@@ -82,6 +107,14 @@ class ReductionWrapperTest(unittest.TestCase):
 
         test_dir = config['defaultsave.directory']
         file = os.path.join(test_dir,'reduce_vars.py')
+        #clear up previous rubbish may be present from other runs
+        if os.path.isfile(file):
+            os.remove(file)
+        fbase,fext = os.path.splitext(file)
+        fcomp = fbase+'.pyc'
+        if os.path.isfile(fcomp):
+            os.remove(fcomp)
+        # save wen variables
         red.save_web_variables(file)
         self.assertTrue(os.path.isfile(file))
 
@@ -166,12 +199,64 @@ class ReductionWrapperTest(unittest.TestCase):
         th.reduce()
 
         save_file = th.reducer.prop_man.save_file_name
-        self.assertEqual(save_file,'SOMETHING100_10.01meV_rings')
+        # such strange name because custom print function above access workspace, 
+        # generated by reduction
+        self.assertEqual(save_file,'SOMETHINGSR_MAR000100#2_reduced_10.01meV_rings')
 
-        th.reducer.prop_man.sample_run = 200
         PropertyManager.incident_energy.next()
         save_file = th.reducer.prop_man.save_file_name
-        self.assertEqual(save_file,'SOMETHING200_20.00meV_rings')
+        # now reduction have not been run, and the name is generated from run number
+        self.assertEqual(save_file,'SOMETHINGSR_MAR000100#2_reduced_20.00meV_rings')
+
+    def test_return_run_list(self):
+        th=test_helper()
+
+        th.reducer.prop_man.sample_run=200
+        th.run_reduction()
+        # standard reduction would save and delete workspace but our simplified one
+        # will just keep it
+        name = 'SR_MAR000200_reduced'
+        self.assertTrue(name in mtd)
+
+        th.reducer.prop_man.sample_run=300
+        # new run deletes the old one
+        self.assertFalse(name in mtd)
+
+        rez = th.run_reduction()
+        self.assertTrue(isinstance(rez,api.Workspace))
+        self.assertTrue('rez' in mtd)
+        self.assertEqual(rez.name(),'rez')
+
+        th.reducer.prop_man.sample_run=[300,400]
+        th.run_reduction()
+        self.assertFalse('SR_MAR000300_reduced' in mtd)
+        self.assertTrue('SR_MAR000400_reduced' in mtd)
+
+        th.reducer.prop_man.sample_run=[500,600]
+        self.assertFalse('SR_MAR000400_reduced' in mtd)
+        th.run_reduction()
+        self.assertFalse('SR_MAR000500_reduced' in mtd)
+        self.assertTrue('SR_MAR000600_reduced' in mtd)
+
+        th.reducer.prop_man.sample_run=[300,400]
+        runs =  th.run_reduction()
+        self.assertTrue('runs#1of2' in mtd)
+        self.assertTrue('runs#2of2' in mtd)
+        self.assertEqual(runs[0].name(),'runs#1of2')
+        self.assertEqual(runs[1].name(),'runs#2of2')
+
+        th.reducer.prop_man.incident_energy=[10,20]
+        th.reducer.prop_man.sample_run=300
+        th.run_reduction()
+        self.assertTrue('SR_MAR000300#1_reduced' in mtd)
+        self.assertTrue('SR_MAR000300#2_reduced' in mtd)
+        th.reducer.prop_man.sample_run=400
+        th.run_reduction()
+        self.assertFalse('SR_MAR000300#1_reduced' in mtd)
+        self.assertFalse('SR_MAR000300#2_reduced' in mtd)
+        self.assertTrue('SR_MAR000400#1_reduced' in mtd)
+        self.assertTrue('SR_MAR000400#2_reduced' in mtd)
+