diff --git a/Core/Geometry/inc/BasicVector3D.h b/Core/Geometry/inc/BasicVector3D.h
index 302b5c086778d4a4e9e781e752dd9d08722f5996..196579894188766cdc5a88879f72040ec37afb49 100644
--- a/Core/Geometry/inc/BasicVector3D.h
+++ b/Core/Geometry/inc/BasicVector3D.h
@@ -350,6 +350,11 @@ template<> BA_CORE_API_ BasicVector3D<double> BasicVector3D<double>::cross(
         const BasicVector3D<double>& v) const;
 
 
+template<> BA_CORE_API_ double BasicVector3D<double>::phi() const;
+
+template<> BA_CORE_API_ double BasicVector3D<double>::theta() const;
+
+
 }  // namespace Geometry
 
 #endif /* GEOMETRY_BASICVECTOR3D_H */
diff --git a/GUI/CMakeLists.txt b/GUI/CMakeLists.txt
index 23ba90e4baa62f8da84f0ac3bb9dd4514daa87e0..b482f0b6c7c4d05bca1a60f053ad86fa94c4a169 100644
--- a/GUI/CMakeLists.txt
+++ b/GUI/CMakeLists.txt
@@ -4,6 +4,8 @@
 
 cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
 
+cmake_policy(SET CMP0020 NEW)
+
 find_package(Qt5Widgets REQUIRED)
 
 add_subdirectory(externals/qt-manhattan-style)
diff --git a/GUI/coregui/CMakeLists.txt b/GUI/coregui/CMakeLists.txt
index 73527ec6cc81e523781e24f00ef43516e96aaeee..7cd9a0a0f043247a77112517e3626fe821c9fc93 100644
--- a/GUI/coregui/CMakeLists.txt
+++ b/GUI/coregui/CMakeLists.txt
@@ -4,6 +4,8 @@
 
 cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
 
+cmake_policy(SET CMP0020 NEW)
+
 set(executable_name coregui)
 
 # --- source and include files ---
@@ -72,6 +74,7 @@ add_executable(${executable_name} ${source_files} ${RC_SRCS} ${include_files})
 
 # --- dependencies ---
 include_directories(
+    ${Boost_INCLUDE_DIRS}
     ${BornAgainCore_INCLUDE_DIRS}
     ${BornAgainFit_INCLUDE_DIRS}
     ${ROOT_INCLUDE_DIR}
@@ -98,8 +101,6 @@ target_link_libraries(${executable_name}
     ${QtRoot_LIBRARY}
 )
 
-message("XXX ${ROOT_LIBRARIES}")
-
 #core gui script webkit webkitwidgets designer designercomponents
 qt5_use_modules(${executable_name} Widgets Core Gui Script WebKit WebKitWidgets Designer)
 
diff --git a/GUI/coregui/Views/Components/SampleDesigner/MaterialBrowserModel.cpp b/GUI/coregui/Views/Components/SampleDesigner/MaterialBrowserModel.cpp
index 345873d0eda268c68c79b1ef5b6371b63cdfbb14..65648b337f10ee1b46f6708d403dc58fa69c1a4c 100644
--- a/GUI/coregui/Views/Components/SampleDesigner/MaterialBrowserModel.cpp
+++ b/GUI/coregui/Views/Components/SampleDesigner/MaterialBrowserModel.cpp
@@ -4,6 +4,7 @@
 #include "HomogeneousMaterial.h"
 #include <QColor>
 #include <QtScript>
+#include "Types.h"
 
 
 #if QT_VERSION < 0x050000
@@ -172,7 +173,7 @@ bool MaterialBrowserModel::setData(const QModelIndex & index, const QVariant & v
                 return false;
             }
             refractiveIndex = mat->getRefractiveIndex();
-            refractiveIndex.real() = double_value;
+            refractiveIndex = complex_t(double_value, refractiveIndex.imag());
             status = MaterialManager::instance().setMaterialRefractiveIndex(mat->getName(), refractiveIndex);
             if(!status) {
                 emit SetDataMessage("Can't set given value of RefractiveIndex");
@@ -190,7 +191,9 @@ bool MaterialBrowserModel::setData(const QModelIndex & index, const QVariant & v
                 return false;
             }
             refractiveIndex = mat->getRefractiveIndex();
-            refractiveIndex.imag() = double_value;
+            //refractiveIndex.imag()=double_value;
+            //refractiveIndex.imag(double_value);
+            refractiveIndex = complex_t(refractiveIndex.real(), double_value);
             status = MaterialManager::instance().setMaterialRefractiveIndex(mat->getName(), refractiveIndex);
             if(!status) {
                 emit SetDataMessage("Can't set given value of RefractiveIndex");
diff --git a/GUI/externals/qt-manhattan-style/CMakeLists.txt b/GUI/externals/qt-manhattan-style/CMakeLists.txt
index eaf7a63155193285e39f3396f4c44b5c1cd1e7fb..56c6736d5cffceeadde9aabdbb63d3d373a3fa4b 100644
--- a/GUI/externals/qt-manhattan-style/CMakeLists.txt
+++ b/GUI/externals/qt-manhattan-style/CMakeLists.txt
@@ -3,6 +3,7 @@
 ############################################################################
 
 cmake_minimum_required(VERSION 2.8.9)
+cmake_policy(SET CMP0020 NEW)
 
 #project(qt-manhattan-style)
 set(library_name ManhattanStyle)
diff --git a/GUI/externals/qt-root-gui-factory/CMakeLists.txt b/GUI/externals/qt-root-gui-factory/CMakeLists.txt
index 62a5c6e3368a1246f4a88a1876292060470fb249..a76b41157427249dfc22c96783080a4c0dde6106 100644
--- a/GUI/externals/qt-root-gui-factory/CMakeLists.txt
+++ b/GUI/externals/qt-root-gui-factory/CMakeLists.txt
@@ -3,6 +3,8 @@
 ############################################################################
 
 cmake_minimum_required(VERSION 2.8.9)
+cmake_policy(SET CMP0020 NEW)
+
 set(library_name QtRoot)
 
 # source files
@@ -17,7 +19,7 @@ ROOT_GENERATE_DICTIONARY(G__QtRoot ${include_files} LINKDEF LinkDef.h)
 # --- making library ---
 add_library(
     ${library_name}
-    SHARED
+    STATIC
     ${source_files} ${include_files} G__QtRoot.cxx
 )
 set(${library_name}_INCLUDE_DIRS ${include_dirs} PARENT_SCOPE)
@@ -29,8 +31,7 @@ include_directories(
     ${GQt_INCLUDE_DIRS}
 )
 
-message("YYY ${ROOT_LIBRARIES}")
-target_link_libraries(${library_name} ${ROOT_LIBRARIES})
+target_link_libraries(${library_name} ${ROOT_LIBRARIES} ${GQt_LIBRARY})
 
 #find_package(Qt5Widgets REQUIRED)
 qt5_use_modules(${library_name} Widgets)
diff --git a/GUI/externals/qt-root/CMakeLists.txt b/GUI/externals/qt-root/CMakeLists.txt
index 758be6b4d1eaf7ccc8f0b2fd363a8d199d82a24d..f42f03202a79651572b8b5a6084af7f44b12ab35 100644
--- a/GUI/externals/qt-root/CMakeLists.txt
+++ b/GUI/externals/qt-root/CMakeLists.txt
@@ -3,6 +3,8 @@
 ############################################################################
 
 cmake_minimum_required(VERSION 2.8.9)
+cmake_policy(SET CMP0020 NEW)
+
 set(library_name GQt)
 
 # source files
@@ -29,7 +31,7 @@ ROOT_GENERATE_DICTIONARY(AppDict    inc/DrawHelper.h inc/TreeEventStructure.h  L
 # --- making library ---
 add_library(
     ${library_name}
-    SHARED
+    STATIC
     ${source_files} ${include_files} ${mocfiles} G__GQt.cxx
 )
 set(${library_name}_INCLUDE_DIRS ${include_dirs} PARENT_SCOPE)
diff --git a/GUI/externals/qt-root/src/TGQt.cxx b/GUI/externals/qt-root/src/TGQt.cxx
index c43b77740d14ce45c507839a99ded9c389b17a94..a0fc31378cf809b8e33efe98b6aa47ec0a76f553 100644
--- a/GUI/externals/qt-root/src/TGQt.cxx
+++ b/GUI/externals/qt-root/src/TGQt.cxx
@@ -1026,7 +1026,7 @@ Bool_t TGQt::Init(void* /*display*/)
          QString libPath = gSystem->GetLinkedLibs();
          // detect the exact name of the Qt library
          TString qtlibdir= "$(QTDIR)";
-         qtlibdir += QDir::separator().toAscii();
+         qtlibdir += QDir::separator().toLatin1();
          qtlibdir += "lib";
 
          gSystem->ExpandPathName(qtlibdir);
@@ -1046,7 +1046,7 @@ Bool_t TGQt::Init(void* /*display*/)
 #else
                   libPath += "QtCore4.lib QtGui4.lib QtOpenGL4.lib Qt3Support4.lib";
 #endif
-               gSystem->SetLinkedLibs(libPath.toAscii().data());
+               gSystem->SetLinkedLibs(libPath.toStdString().c_str());
             }
          } else {
             qWarning(" Can not open the QTDIR %s",(const char*)qtlibdir);
diff --git a/GUI/externals/qt-root/src/TQtApplication.cxx b/GUI/externals/qt-root/src/TQtApplication.cxx
index a246b3ab673092690bd28f49506fbc513c14d960..b82c04241a8abe50a51bc7770327acbe42211c37 100644
--- a/GUI/externals/qt-root/src/TQtApplication.cxx
+++ b/GUI/externals/qt-root/src/TQtApplication.cxx
@@ -57,6 +57,7 @@ TQtApplication::TQtApplication(const char * /*appClassName*/, int &argc,char **a
 //______________________________________________________________________________
 TQtApplication::~TQtApplication()
 { }
+#include <iostream>
 //______________________________________________________________________________
 void TQtApplication::CreateQApplication(int &argc, char ** argv, bool GUIenabled)
 {
@@ -126,10 +127,12 @@ void TQtApplication::CreateQApplication(int &argc, char ** argv, bool GUIenabled
    }
   
    // Add Qt plugin path if  present (it is the case for Windows binary ROOT distribution)
-   char *qtPluginPath = gSystem->ConcatFileName(gSystem->Getenv("ROOTSYS"),"/Qt/plugins");
-   if (!gSystem->AccessPathName(qtPluginPath))
-       qApp->addLibraryPath(qtPluginPath);
-   delete [] qtPluginPath;
+   // FIXME I have commented this code 19.09.2013, program was crashing
+//   char *qtPluginPath = gSystem->ConcatFileName(gSystem->Getenv("ROOTSYS"),"/Qt/plugins");
+//   std::cout << "XXXXX qtPluginPath" << qtPluginPath << std::endl;
+//   if (!gSystem->AccessPathName(qtPluginPath))
+//       qApp->addLibraryPath(qtPluginPath);
+//   delete [] qtPluginPath;
 }
 //______________________________________________________________________________
 void TQtApplication::CreateGUIThread(int &argc, char **argv)
diff --git a/GUI/externals/qt-root/src/TQtWidget.cxx b/GUI/externals/qt-root/src/TQtWidget.cxx
index af9fc674802ef5803ea4725486c0364942117bd4..546867dfa0437d0d87f1f7c7d6012f89f5f81738 100644
--- a/GUI/externals/qt-root/src/TQtWidget.cxx
+++ b/GUI/externals/qt-root/src/TQtWidget.cxx
@@ -26,9 +26,11 @@
 #  include <QDebug>
 #endif /* QT_VERSION */
 
-# if QT_VERSION >= 0x40000 and QT_VERSION <0x50000
+# if QT_VERSION >= 0x40000 
+# if QT_VERSION <0x50000
 #  include <QCustomEvent>
 #endif
+#endif
 
 
 #include "TQtWidget.h"
@@ -240,10 +242,15 @@ void TQtWidget::Init()
       HICON hIcon = ::LoadIcon(::GetModuleHandle(NULL), MAKEINTRESOURCE(101));
       if (!hIcon) hIcon = LoadIcon(NULL, IDI_APPLICATION);
       rootIcon = hIcon;
-      SetClassLong(winId(),        // handle to window
+//      SetClassLong(winId(),        // handle to window
+//                   GCL_HICON,      // index of value to change
+//                   LONG(rootIcon)  // new value
+//      );
+      SetClassLongPtr((HWND)winId(),        // handle to window
                    GCL_HICON,      // index of value to change
                    LONG(rootIcon)  // new value
       );
+
     }
 #endif
 }
@@ -739,7 +746,7 @@ void TQtWidget::resizeEvent(QResizeEvent *e)
       if (!fPaint)  {
          // real resize event
          fSizeChanged=kTRUE;
-         fNeedStretch=ktrue;
+         fNeedStretch=kTRUE;
       } else {
 #else
       {
diff --git a/cmake/modules/FindROOT.cmake b/cmake/modules/FindROOT.cmake
index 006979a27c8d789a533fabec7f246acb459f65ad..415b3c7bc5c879745e796755b3123e82e484573b 100644
--- a/cmake/modules/FindROOT.cmake
+++ b/cmake/modules/FindROOT.cmake
@@ -20,7 +20,7 @@ else()
         set(ROOT_INCLUDE_DIR ${ROOTSYS}/include)
         set(ROOT_LIBRARY_DIR ${ROOTSYS}/lib)
         #set(ROOT_LIBRARIES -LIBPATH:${ROOT_LIBRARY_DIR} libGpad.lib libHist.lib libGraf.lib libGraf3d.lib libTree.lib libRint.lib libPostscript.lib libMatrix.lib libPhysics.lib libMathCore.lib libRIO.lib libNet.lib libThread.lib libCore.lib libCint.lib)
-        set(ROOT_LIBRARIES -LIBPATH:${ROOT_LIBRARY_DIR} libGpad.lib libHist.lib libGraf.lib libGraf3d.lib libTree.lib libRint.lib libPostscript.lib libMatrix.lib libMathCore.lib libRIO.lib libNet.lib libThread.lib libCore.lib libCint.lib)
+        set(ROOT_LIBRARIES -LIBPATH:${ROOT_LIBRARY_DIR} libGui.lib libGpad.lib libHist.lib libGraf.lib libGraf3d.lib libTree.lib libRint.lib libPostscript.lib libMatrix.lib libMathCore.lib libRIO.lib libNet.lib libThread.lib libCore.lib libCint.lib)
     else()
 
         execute_process(
diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake
index c102fe4593904a2adc2316cac2aed3d1f6bd8677..f28c67d31a03e09cb6a2d0bfc4fa5bd4eb1b115d 100644
--- a/cmake/modules/SearchInstalledSoftware.cmake
+++ b/cmake/modules/SearchInstalledSoftware.cmake
@@ -67,6 +67,8 @@ if(BORNAGAIN_PYTHON OR BORNAGAIN_GUI)
     endif()
     find_package(Numpy REQUIRED)
 endif()
+message("XXX ${PYTHON_LIBRARIES}")
+
 
 # --- ROOT ---
 find_package(ROOT)