diff --git a/core/base/inc/Bswapcpy.h b/core/base/inc/Bswapcpy.h
index b8cb7ecf6be8b8732c2ca4851c4fd038d6fad860..0dc9af148e4aeea9ad9e1e03d6e91052e3bfe505 100644
--- a/core/base/inc/Bswapcpy.h
+++ b/core/base/inc/Bswapcpy.h
@@ -38,6 +38,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#if !defined(__CINT__)
+#include <sys/types.h>
+#endif
+
 extern inline void * bswapcpy16(void * to, const void * from, size_t n)
 {
 int d0, d1, d2, d3;
diff --git a/core/base/inc/Match.h b/core/base/inc/Match.h
index 0c8645c47ec77fb3e95a4a28311b5517c33350ea..7a67aeb6436b5fc255b6dadaebafbe8d60a4b4a9 100644
--- a/core/base/inc/Match.h
+++ b/core/base/inc/Match.h
@@ -19,6 +19,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#if !defined(__CINT__)
+#include <sys/types.h>
+#endif
+
 typedef unsigned short Pattern_t;
 
 int         Makepat(const char*, Pattern_t*, int);
diff --git a/core/base/inc/TVirtualTableInterface.h b/core/base/inc/TVirtualTableInterface.h
index 348737b85990230b034f5f73227cb84d32efe564..ef8f4f9f68dfc0e19d6f4ea2a322520efed36165 100644
--- a/core/base/inc/TVirtualTableInterface.h
+++ b/core/base/inc/TVirtualTableInterface.h
@@ -11,6 +11,11 @@
 #ifndef ROOT_TVirtualTableInterface
 #define ROOT_TVirtualTableInterface
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
+
 class TVirtualTableInterface {
 
 public:
@@ -20,8 +25,8 @@ public:
    virtual Double_t    GetValue(UInt_t row, UInt_t column) = 0;
    virtual const char *GetValueAsString(UInt_t row, UInt_t column) = 0;
    virtual const char *GetRowHeader(UInt_t row) = 0;
-   virtual const char *GetColumnHeader(UInt_t column) = 0; 
-   virtual UInt_t      GetNRows() = 0; 
+   virtual const char *GetColumnHeader(UInt_t column) = 0;
+   virtual UInt_t      GetNRows() = 0;
    virtual UInt_t      GetNColumns() = 0;
 
    ClassDef(TVirtualTableInterface, 0)
diff --git a/core/meta/inc/TGenericClassInfo.h b/core/meta/inc/TGenericClassInfo.h
index c5ed65a6a4f8884804ed0786c56dd64979e06fb5..c8ce20eae98c584ff10631e718913c84f3b861bc 100644
--- a/core/meta/inc/TGenericClassInfo.h
+++ b/core/meta/inc/TGenericClassInfo.h
@@ -13,13 +13,23 @@
 #define ROOT_TGenericClassInfo
 
 #include <vector>
+//#ifndef ROOT_TSchemaHelper
 #include "TSchemaHelper.h"
+//#endif
+//#ifndef ROOT_Rtypes
+//#inlcude "Rtypes.h"
+//#endif
 
 // Forward declarations
 class TVirtualIsAProxy;
+//class TClass;
+//class TClassStreamer;
+//class TVirtualCollectionProxy;
+//class TCollectionProxyInfo;
+
 
 namespace ROOT {
-   
+
    class TCollectionProxyInfo;
 
    class TGenericClassInfo {
@@ -52,7 +62,7 @@ namespace ROOT {
       TCollectionProxyInfo       *fCollectionStreamerInfo;
       std::vector<TSchemaHelper>  fReadRules;
       std::vector<TSchemaHelper>  fReadRawRules;
-      
+
    public:
       TGenericClassInfo(const char *fullClassname,
                        const char *declFileName, Int_t declFileLine,
@@ -69,7 +79,7 @@ namespace ROOT {
       TGenericClassInfo(const char *fullClassname, Int_t version,
                        const char *declFileName, Int_t declFileLine,
                        const type_info &info, const TInitBehavior *action,
-                       VoidFuncPtr_t dictionary, 
+                       VoidFuncPtr_t dictionary,
                        TVirtualIsAProxy *isa, Int_t pragmabits, Int_t sizof);
 
       TGenericClassInfo(const char *fullClassname, Int_t version,
@@ -127,9 +137,9 @@ namespace ROOT {
       void CreateRuleSet( std::vector<TSchemaHelper>& vect, Bool_t ProcessReadRules );
       TGenericClassInfo(const TGenericClassInfo&); // Not implemented
       TGenericClassInfo& operator=(const TGenericClassInfo&); // Not implemented
-      
+
    private:
-      TGenericClassInfo(); 
+      TGenericClassInfo();
 
    };
 
diff --git a/core/meta/inc/TSchemaHelper.h b/core/meta/inc/TSchemaHelper.h
index 15e560a1a267f77715d0e6ba374cb1b895797d4c..d1be5f95f8eb4330221e27c957d912847aa58dc4 100644
--- a/core/meta/inc/TSchemaHelper.h
+++ b/core/meta/inc/TSchemaHelper.h
@@ -5,6 +5,9 @@
 #define ROOT_TSchemaHelper
 
 #include <string>
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
 
 namespace ROOT
 {
diff --git a/graf2d/gpad/inc/TCreatePrimitives.h b/graf2d/gpad/inc/TCreatePrimitives.h
index f0c39aeed3bd1dc9af2047cb46fbaa4c11598bdd..d3678d9ec0282e57287c2069d60a87f37eff3d7f 100644
--- a/graf2d/gpad/inc/TCreatePrimitives.h
+++ b/graf2d/gpad/inc/TCreatePrimitives.h
@@ -23,6 +23,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 class TCreatePrimitives {
 
 public:
@@ -38,4 +42,3 @@ public:
 };
 
 #endif
-
diff --git a/graf3d/gl/inc/TGLManip.h b/graf3d/gl/inc/TGLManip.h
index 020cd5db407adb7fd10b6a0a52916397fef3ec10..94871ee5e906163aeded0475a3d478838740e48b 100644
--- a/graf3d/gl/inc/TGLManip.h
+++ b/graf3d/gl/inc/TGLManip.h
@@ -21,8 +21,8 @@
 #ifndef ROOT_GuiTypes
 #include "GuiTypes.h"
 #endif
-#ifndef ROOT_Rtypes
-#include "Rtypes.h"
+#ifndef ROOT_TGLUtil
+#include "TGLUtil.h"
 #endif
 
 class TGLPhysicalShape;
diff --git a/graf3d/gl/inc/TGLRotateManip.h b/graf3d/gl/inc/TGLRotateManip.h
index fe15fb475834d07217ef233caf4e817203a2f590..8fa1fcb5150bff973b48b1d93ba1b9bccc1c29d2 100644
--- a/graf3d/gl/inc/TGLRotateManip.h
+++ b/graf3d/gl/inc/TGLRotateManip.h
@@ -15,9 +15,7 @@
 #ifndef ROOT_TGLManip
 #include "TGLManip.h"
 #endif
-#ifndef ROOT_TGLUtil
-#include "TGLUtil.h"
-#endif
+
 
 class TGLRotateManip : public TGLManip
 {
diff --git a/graf3d/gl/inc/TGLScaleManip.h b/graf3d/gl/inc/TGLScaleManip.h
index cd0c70691d5760b8b556b6b481a53580034b0c99..e5254526772d718c95a407903599506082c9cac5 100644
--- a/graf3d/gl/inc/TGLScaleManip.h
+++ b/graf3d/gl/inc/TGLScaleManip.h
@@ -15,9 +15,7 @@
 #ifndef ROOT_TGLManip
 #include "TGLManip.h"
 #endif
-#ifndef ROOT_TGLUtil
-#include "TGLUtil.h"
-#endif
+
 
 //////////////////////////////////////////////////////////////////////////
 //                                                                      //
diff --git a/graf3d/gl/inc/TGLUtil.h b/graf3d/gl/inc/TGLUtil.h
index 83d39ea88a44f97ae4d99a28b6b8437aadfc4f65..d46726b6c7429ca86dfa85ec25e8f6e6f212f1de 100644
--- a/graf3d/gl/inc/TGLUtil.h
+++ b/graf3d/gl/inc/TGLUtil.h
@@ -12,8 +12,12 @@
 #ifndef ROOT_TGLUtil
 #define ROOT_TGLUtil
 
+#ifndef ROOT_Rtypes
 #include "Rtypes.h"
+#endif
+#ifndef ROOT_TError
 #include "TError.h"
+#endif
 
 class TString;
 class TGLBoundingBox;
diff --git a/gui/ged/inc/TPieEditor.h b/gui/ged/inc/TPieEditor.h
index 382862ba0437a78a74fcabebd0652496629be149..19e312bc2d8eaab1346796a00c1d5b86327bbdd9 100644
--- a/gui/ged/inc/TPieEditor.h
+++ b/gui/ged/inc/TPieEditor.h
@@ -31,7 +31,7 @@ class TGRadioButton;
 class TGNumberEntry;
 class TGColorSelect;
 class TGFontTypeComboBox;
-class TGComboox;
+class TGCombox;
 
 class TPieEditor : public TGedFrame {
 
@@ -52,20 +52,20 @@ protected:
    TGColorSelect       *fColorSelect; // font color selector
    TGFontTypeComboBox  *fTypeCombo; // font style
    TGComboBox          *fSizeCombo; // font size
-   
+
    virtual void ConnectSignals2Slots();
 
    static TGComboBox* BuildFontSizeComboBox(TGFrame*, Int_t);
-   
+
 public:
-   TPieEditor(const TGWindow *p = 0, 
+   TPieEditor(const TGWindow *p = 0,
                Int_t width = 140, Int_t height = 30,
                UInt_t options = kChildFrame,
                Pixel_t back = GetDefaultFrameBackground());
    virtual ~TPieEditor();
    virtual void SetModel(TObject* );
    virtual void ActivateBaseClassEditors(TClass*);
-   
+
    // slots related to graph attributes
    virtual void DoShape();
    virtual void DoMarkerOnOff(Bool_t on);
@@ -73,8 +73,7 @@ public:
    virtual void DoGraphLineWidth();
    virtual void DoChange3DAngle();
    virtual void DoTextChange();
-   
+
    ClassDef(TPieEditor,0)        // piechart editor
 };
 #endif
-
diff --git a/gui/gui/inc/WidgetMessageTypes.h b/gui/gui/inc/WidgetMessageTypes.h
index b4d5aadd807dd120581968718a2ea989eb415754..7c8201cc0ad334d3831323bbc4182e030b0604c1 100644
--- a/gui/gui/inc/WidgetMessageTypes.h
+++ b/gui/gui/inc/WidgetMessageTypes.h
@@ -26,6 +26,11 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
+
 enum EWidgetMessageTypes {
    kC_COMMAND          = 1,
       kCM_MENU            = 1,
diff --git a/gui/guihtml/inc/TGHtmlUri.h b/gui/guihtml/inc/TGHtmlUri.h
index 9383104e04b71945046b838b76c4b2a2c3001834..20eb8ec31400fed9a6204d3d6bf6c4967e8fed10 100644
--- a/gui/guihtml/inc/TGHtmlUri.h
+++ b/gui/guihtml/inc/TGHtmlUri.h
@@ -1,4 +1,4 @@
-// $Id$
+// @(#)root/guihtml:$Id: TObject.h 20877 2007-11-19 11:17:07Z rdm $
 // Author:  Valeriy Onuchin   03/05/2007
 
 /*************************************************************************
@@ -34,6 +34,10 @@
 #ifndef ROOT_TGHtmlUri
 #define ROOT_TGHtmlUri
 
+#ifndef ROOT_TObject
+#include "TObject.h"
+#endif
+
 #define URI_SCHEME_MASK     (1<<0)
 #define URI_AUTH_MASK       (1<<1)
 #define URI_PATH_MASK       (1<<2)
@@ -61,7 +65,7 @@ public:
 
 public:
    int ComponentLength(const char *z, const char *zInit, const char *zTerm);
-  
+
    char *fZScheme;             // Ex: "http"
    char *fZAuthority;          // Ex: "192.168.1.1:8080"
    char *fZPath;               // Ex: "cgi-bin/printenv"
@@ -69,5 +73,4 @@ public:
    char *fZFragment;           // Ex: "frag"
 };
 
-
 #endif  // ROOT_TGHtmlUri
diff --git a/gui/sessionviewer/inc/TProofProgressLog.h b/gui/sessionviewer/inc/TProofProgressLog.h
index 33b210f29bad472c62e3a63a5b7ea300459b0cb3..f2a0050145c6100bad598fef95b3f58ee94a59dc 100644
--- a/gui/sessionviewer/inc/TProofProgressLog.h
+++ b/gui/sessionviewer/inc/TProofProgressLog.h
@@ -38,6 +38,8 @@ class TGNumberEntry;
 class TGListBox;
 class TGSplitButton;
 class TGVerticalFrame;
+class TGCheckButton;
+
 
 class TProofProgressLog : public TGTransientFrame {
 
diff --git a/math/matrix/inc/TMatrixDBasefwd.h b/math/matrix/inc/TMatrixDBasefwd.h
index a8523da59da8f9647afeb626eb4186fb41543e2b..529d6ec60c38bcbacf312f6071272bd830508a8b 100644
--- a/math/matrix/inc/TMatrixDBasefwd.h
+++ b/math/matrix/inc/TMatrixDBasefwd.h
@@ -20,6 +20,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 template<class Element> class TMatrixTBase;
 typedef TMatrixTBase<Double_t> TMatrixDBase;
 
diff --git a/math/matrix/inc/TMatrixDSparsefwd.h b/math/matrix/inc/TMatrixDSparsefwd.h
index 2ea39e5a9e84239f39e95e274252705ea38efc29..f8d55d9dcf56f894ac3fb84585a778ebf5e254e6 100644
--- a/math/matrix/inc/TMatrixDSparsefwd.h
+++ b/math/matrix/inc/TMatrixDSparsefwd.h
@@ -17,6 +17,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 template<class Element> class TMatrixTSparse;
 typedef TMatrixTSparse<Double_t> TMatrixDSparse;
 
diff --git a/math/matrix/inc/TMatrixDSymfwd.h b/math/matrix/inc/TMatrixDSymfwd.h
index b014db3daaa0a871e43f05d4d6f288172df39206..b5ffc669ca867f8a181f794551f0879e8c8b5e2b 100644
--- a/math/matrix/inc/TMatrixDSymfwd.h
+++ b/math/matrix/inc/TMatrixDSymfwd.h
@@ -17,6 +17,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 template<class Element> class TMatrixTSym;
 typedef TMatrixTSym<Double_t> TMatrixDSym;
 
diff --git a/math/matrix/inc/TMatrixDUtilsfwd.h b/math/matrix/inc/TMatrixDUtilsfwd.h
index 9739f0217c45387a71810b24f5c2844c4d049955..709b3b1bd04fcea162fa7c24f836a826f0162663 100644
--- a/math/matrix/inc/TMatrixDUtilsfwd.h
+++ b/math/matrix/inc/TMatrixDUtilsfwd.h
@@ -30,6 +30,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 template<class Element> class TMatrixTRow_const;
 template<class Element> class TMatrixTColumn_const;
 template<class Element> class TMatrixTDiag_const;
diff --git a/math/matrix/inc/TMatrixFBasefwd.h b/math/matrix/inc/TMatrixFBasefwd.h
index 6b97ff1141c191d50f4195223dc1212572df4d3f..e77d4a6ef68813d897c160a1499c32792469589a 100644
--- a/math/matrix/inc/TMatrixFBasefwd.h
+++ b/math/matrix/inc/TMatrixFBasefwd.h
@@ -20,6 +20,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 template<class Element> class TMatrixTBase;
 typedef TMatrixTBase<Float_t> TMatrixFBase;
 
diff --git a/math/matrix/inc/TMatrixFSparsefwd.h b/math/matrix/inc/TMatrixFSparsefwd.h
index 10d79419fc7b50493eff68f9a1366a737d1d0975..93158973f47d567f9fb5d69b1569f4992b4c3f50 100644
--- a/math/matrix/inc/TMatrixFSparsefwd.h
+++ b/math/matrix/inc/TMatrixFSparsefwd.h
@@ -17,6 +17,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 template<class Element> class TMatrixTSparse;
 typedef TMatrixTSparse<Float_t> TMatrixFSparse;
 
diff --git a/math/matrix/inc/TMatrixFSymfwd.h b/math/matrix/inc/TMatrixFSymfwd.h
index 8ff5f5209308a83cd24f514abbae0a2e0ed056ef..aa81e34bfe52c822cceee79d990cf61de457c078 100644
--- a/math/matrix/inc/TMatrixFSymfwd.h
+++ b/math/matrix/inc/TMatrixFSymfwd.h
@@ -17,6 +17,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 template<class Element> class TMatrixTSym;
 typedef TMatrixTSym<Float_t> TMatrixFSym;
 
diff --git a/math/matrix/inc/TMatrixFUtilsfwd.h b/math/matrix/inc/TMatrixFUtilsfwd.h
index ba1bef7050608bee2625c1c28982c2c7390b8337..5a328414a65e9e56c34bddde740e024e2693592b 100644
--- a/math/matrix/inc/TMatrixFUtilsfwd.h
+++ b/math/matrix/inc/TMatrixFUtilsfwd.h
@@ -30,6 +30,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 template<class Element> class TMatrixTRow_const;
 template<class Element> class TMatrixTColumn_const;
 template<class Element> class TMatrixTDiag_const;
diff --git a/math/matrix/inc/TMatrixFfwd.h b/math/matrix/inc/TMatrixFfwd.h
index 59a4624e3ccf8657c9a5603b726e10eeb5277023..f8c7a654b2721b085b917711f4666c8f3d248db5 100644
--- a/math/matrix/inc/TMatrixFfwd.h
+++ b/math/matrix/inc/TMatrixFfwd.h
@@ -17,6 +17,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 template<class Element> class TMatrixT;
 typedef TMatrixT<Float_t> TMatrixF;
 
diff --git a/math/matrix/inc/TVectorDfwd.h b/math/matrix/inc/TVectorDfwd.h
index 57cd79f432749fb7a17e9547d5411202e7db8a12..6ef42765e572136e0271f66b742a9f1bce563b56 100644
--- a/math/matrix/inc/TVectorDfwd.h
+++ b/math/matrix/inc/TVectorDfwd.h
@@ -17,6 +17,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 template<class Element> class TVectorT;
 typedef TVectorT<Double_t> TVectorD;
 
diff --git a/math/matrix/inc/TVectorFfwd.h b/math/matrix/inc/TVectorFfwd.h
index 0536b3e8d7fe09daa5e1a03fa788ec1a8828b981..d95975080d20d959d70c41bf1b8b3ccf91b6ff92 100644
--- a/math/matrix/inc/TVectorFfwd.h
+++ b/math/matrix/inc/TVectorFfwd.h
@@ -17,6 +17,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 template<class Element> class TVectorT;
 typedef TVectorT<Float_t> TVectorF;
 
diff --git a/math/matrix/inc/TVectorfwd.h b/math/matrix/inc/TVectorfwd.h
index 77f6b9635bb6657b80f6e80acae10356205f63ad..52741b7a9e7b9ae336e2d971891b992208eb21f5 100644
--- a/math/matrix/inc/TVectorfwd.h
+++ b/math/matrix/inc/TVectorfwd.h
@@ -17,6 +17,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 template<class Element> class TVectorT;
 typedef TVectorT<Float_t> TVector;
 
diff --git a/math/physics/inc/TQuaternion.h b/math/physics/inc/TQuaternion.h
index 9b17a3618c1d3550a0d7c6b00d2497338e87bb95..ad0e730184647c278e84dec4bd5aa6fdf9936aef 100644
--- a/math/physics/inc/TQuaternion.h
+++ b/math/physics/inc/TQuaternion.h
@@ -4,7 +4,13 @@
 #ifndef ROOT_TQuaternion
 #define ROOT_TQuaternion
 
+#ifndef ROOT_TVector3
 #include "TVector3.h"
+#endif
+#ifndef ROOT_TMath
+#include "TMath.h"
+#endif
+
 
 class TQuaternion : public TObject {
 
@@ -117,13 +123,13 @@ public:
 inline TQuaternion& TQuaternion::SetRXYZ(Double_t r,Double_t x,Double_t y,Double_t z) {
    fRealPart = r;
    fVectorPart.SetXYZ(x,y,z);
-   return (*this); 
+   return (*this);
 }
 
 inline TQuaternion& TQuaternion::SetRV(Double_t r, TVector3& vect) {
    fRealPart = r;
    fVectorPart= vect;
-   return (*this); 
+   return (*this);
 }
 
 inline void TQuaternion::GetRXYZ(Double_t *carray) const {
@@ -160,18 +166,18 @@ inline TQuaternion& TQuaternion::operator+=(Double_t real) {
    return (*this);
 }
 
-inline TQuaternion& TQuaternion::operator-=(Double_t real) { 
-   fRealPart -= real; 
-   return (*this); 
+inline TQuaternion& TQuaternion::operator-=(Double_t real) {
+   fRealPart -= real;
+   return (*this);
 }
 
-inline TQuaternion& TQuaternion::operator*=(Double_t real) { 
+inline TQuaternion& TQuaternion::operator*=(Double_t real) {
    fRealPart *= real;
    fVectorPart *= real;
    return (*this);
 }
 
-inline TQuaternion& TQuaternion::operator/=(Double_t real) { 
+inline TQuaternion& TQuaternion::operator/=(Double_t real) {
    if (real!=0) {
       fRealPart /= real;
       fVectorPart.SetX(fVectorPart.x()/real); // keep numericaly compliant with operator/(Double_t)
@@ -248,7 +254,7 @@ inline TQuaternion& TQuaternion::operator-=(const TQuaternion &quaternion) {
 }
 
 inline TQuaternion TQuaternion::operator+(const TQuaternion &quaternion) const {
-        
+
    return TQuaternion(fVectorPart+quaternion.fVectorPart, fRealPart+quaternion.fRealPart);
 }
 
@@ -259,7 +265,7 @@ inline TQuaternion TQuaternion::operator-(const TQuaternion &quaternion) const {
 
 // ---------------- general
 inline Double_t TQuaternion::Norm() const {
-   return sqrt(Norm2());
+   return TMath::Sqrt(Norm2());
 }
 
 inline Double_t TQuaternion::Norm2() const {
@@ -267,7 +273,7 @@ inline Double_t TQuaternion::Norm2() const {
 }
 
 inline TQuaternion& TQuaternion::Normalize() {
-        
+
    (*this) /= Norm();
    return (*this);
 }
@@ -282,4 +288,3 @@ inline TQuaternion TQuaternion::Conjugate() const {
 
 #endif
 
-
diff --git a/math/physics/inc/TVector3.h b/math/physics/inc/TVector3.h
index 8ddafec9a961cd38c4f418ed79af4bc6db4f8639..7ed03b0f6ed7c2470e4842a8bb358b1488e01ed8 100644
--- a/math/physics/inc/TVector3.h
+++ b/math/physics/inc/TVector3.h
@@ -11,9 +11,15 @@
 #ifndef ROOT_TVector3
 #define ROOT_TVector3
 
+#ifndef ROOT_TError
 #include "TError.h"
+#endif
+#ifndef ROOT_TVector2
 #include "TVector2.h"
+#endif
+#ifndef ROOT_TMatrix
 #include "TMatrix.h"
+#endif
 
 class TRotation;
 
@@ -61,14 +67,14 @@ public:
    inline void SetXYZ(Double_t x, Double_t y, Double_t z);
    void        SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi);
    void        SetPtThetaPhi(Double_t pt, Double_t theta, Double_t phi);
-  
+
    inline void GetXYZ(Double_t *carray) const;
    inline void GetXYZ(Float_t *carray) const;
    // Get the components into an array
    // not checked!
 
    Double_t Phi() const;
-   // The azimuth angle. returns phi from -pi to pi 
+   // The azimuth angle. returns phi from -pi to pi
 
    Double_t Theta() const;
    // The polar angle.
diff --git a/misc/memstat/inc/TMemStat.h b/misc/memstat/inc/TMemStat.h
index 6035ff3ff63667b29cc59c0dbb54e7a367923606..e5364000f730d86d8c3bfc1b81bc58c329e4afad 100644
--- a/misc/memstat/inc/TMemStat.h
+++ b/misc/memstat/inc/TMemStat.h
@@ -8,18 +8,27 @@
  * For the licensing terms see $ROOTSYS/LICENSE.                         *
  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
  *************************************************************************/
-#ifndef ROOT_TMEMSTAT
-#define ROOT_TMEMSTAT
+
+#ifndef ROOT_TMemStat
+#define ROOT_TMemStat
 
 // STD
 #include <memory>
 #include <vector>
 #include <set>
 // ROOT
+#ifndef ROOT_TString
 #include "TString.h"
+#endif
+#ifndef ROOT_TObjArray
 #include "TObjArray.h"
+#endif
+#ifndef ROOT_TFile
 #include "TFile.h"
+#endif
+#ifndef ROOT_TObjString
 #include "TObjString.h"
+#endif
 
 class TArrayI;
 class TBits;
diff --git a/misc/memstat/inc/TMemStatDepend.h b/misc/memstat/inc/TMemStatDepend.h
index 1da32ae9a06d2f7d4f8ca680bba3cc2f56189954..571764d96bab8f2f9bad6c21979c4aca4e2572f9 100644
--- a/misc/memstat/inc/TMemStatDepend.h
+++ b/misc/memstat/inc/TMemStatDepend.h
@@ -8,8 +8,16 @@
  * For the licensing terms see $ROOTSYS/LICENSE.                         *
  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
  *************************************************************************/
-#ifndef ROOT_TMEMSTATDEPEND
-#define ROOT_TMEMSTATDEPEND
+
+#ifndef ROOT_TMemStatDepend
+#define ROOT_TMemStatDepend
+
+#if !defined(__CINT__)
+#include <sys/types.h>
+#endif
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
 
 //
 //  TMemStatDepend
@@ -44,4 +52,3 @@ public:
 };
 
 #endif
-
diff --git a/misc/memstat/inc/TMemStatDrawDlg.h b/misc/memstat/inc/TMemStatDrawDlg.h
index 20d64369394aaadde99044228f71a0b773087f48..3e5dc814b8e8d7e2770759034fa3599c1d5c60d5 100644
--- a/misc/memstat/inc/TMemStatDrawDlg.h
+++ b/misc/memstat/inc/TMemStatDrawDlg.h
@@ -8,15 +8,20 @@
  * For the licensing terms see $ROOTSYS/LICENSE.                         *
  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
  *************************************************************************/
-#ifndef _ROOT_TMEMSTATDRAWDLG_H
-#define _ROOT_TMEMSTATDRAWDLG_H
+
+#ifndef ROOT_TMemStatDrawDlg
+#define ROOT_TMemStatDrawDlg
 
 // STD
 #include <vector>
 #include <string>
 // ROOT
+#ifndef ROOT_RQ_OBJECT
 #include "RQ_OBJECT.h"
+#endif
+#ifndef ROOT_TGFrame
 #include "TGFrame.h"
+#endif
 
 class TMemStat;
 class TGComboBox;
diff --git a/misc/memstat/inc/TMemStatHelpers.h b/misc/memstat/inc/TMemStatHelpers.h
index 724f208d3c855452e485e1a3ff08759a23bbdf33..4dc2b50627420f3e735884e240675ffaea6cb562 100644
--- a/misc/memstat/inc/TMemStatHelpers.h
+++ b/misc/memstat/inc/TMemStatHelpers.h
@@ -8,13 +8,20 @@
  * For the licensing terms see $ROOTSYS/LICENSE.                         *
  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
  *************************************************************************/
-#ifndef ROOT_HELPERS_
-#define ROOT_HELPERS_
+
+#ifndef ROOT_TMemStatHelpers
+#define ROOT_TMemStatHelpers
 
 // ROOT
+#ifndef ROOT_TString
 #include "TString.h"
+#endif
+#ifndef ROOT_TObjString
 #include "TObjString.h"
+#endif
+#ifndef ROOT_TCollection
 #include "TCollection.h"
+#endif
 // STD
 #include <string>
 #include <functional>
diff --git a/misc/memstat/inc/TMemStatInfo.h b/misc/memstat/inc/TMemStatInfo.h
index 8c1583ef313bb3c790aaff4bdd980e49513360c5..0b29d95a51b7459c0f6538ed0aef5572e5982bec 100644
--- a/misc/memstat/inc/TMemStatInfo.h
+++ b/misc/memstat/inc/TMemStatInfo.h
@@ -8,8 +8,9 @@
  * For the licensing terms see $ROOTSYS/LICENSE.                         *
  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
  *************************************************************************/
-#ifndef ROOT_TMEMSTATINFO
-#define ROOT_TMEMSTATINFO
+
+#ifndef ROOT_TMemStatInfo
+#define ROOT_TMemStatInfo
 
 
 //****************************************************************************//
@@ -26,10 +27,13 @@
 #include <iomanip>
 #include <sstream>
 //ROOT
+#ifndef ROOT_TROOT
 #include "TROOT.h"
-#include "TObject.h"
+#endif
 // Memstat
+#ifndef ROOT_TMemStatHelpers
 #include "TMemStatHelpers.h"
+#endif
 
 class TMemStatStackInfo;
 class TMemStatManager;
diff --git a/misc/memstat/inc/TMemStatManager.h b/misc/memstat/inc/TMemStatManager.h
index 1f25376d3b1430d45facf2c9c499506078923300..144c6478ae5493c0b976bad00dd4e9a4561c2431 100644
--- a/misc/memstat/inc/TMemStatManager.h
+++ b/misc/memstat/inc/TMemStatManager.h
@@ -8,8 +8,9 @@
  * For the licensing terms see $ROOTSYS/LICENSE.                         *
  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
  *************************************************************************/
-#ifndef ROOT_TMEMSTATMANAGER
-#define ROOT_TMEMSTATMANAGER
+
+#ifndef ROOT_TMemStatManager
+#define ROOT_TMemStatManager
 
 //****************************************************************************//
 //
@@ -23,11 +24,19 @@
 #include <memory>
 #include <cstdlib>
 // ROOT
+#ifndef ROOT_TObject
 #include "TObject.h"
+#endif
+#ifndef ROOT_TTimeStamp
 #include "TTimeStamp.h"
+#endif
 // Memstat
+#ifndef ROOT_TMemStatDepend
 #include "TMemStatDepend.h"
+#endif
+#ifndef ROOT_TmemStatInfo
 #include "TMemStatInfo.h"
+#endif
 
 
 class TTree;
diff --git a/misc/memstat/inc/TMemStatResource.h b/misc/memstat/inc/TMemStatResource.h
index 52cb650c8cf9d379d1c2ff24597aeedc4a6008e8..4256f682f8361a123c9fa757016728e2b3629596 100644
--- a/misc/memstat/inc/TMemStatResource.h
+++ b/misc/memstat/inc/TMemStatResource.h
@@ -8,8 +8,9 @@
  * For the licensing terms see $ROOTSYS/LICENSE.                         *
  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
  *************************************************************************/
-#ifndef ROOT_MEMSTAT_RESOURCE_
-#define ROOT_MEMSTAT_RESOURCE_
+
+#ifndef ROOT_TMemStatResource
+#define ROOT_TMemStatResource
 
 // radio buttons of SortStat IDs
 #define rbtnTotalAllocCount     30
diff --git a/misc/memstat/inc/TMemStatViewerGUI.h b/misc/memstat/inc/TMemStatViewerGUI.h
index ad2e3b1dcd975117de4d0eaf104c1ad2a037623e..8306ef4b4af44d805f015c5c93fccdd584572e18 100644
--- a/misc/memstat/inc/TMemStatViewerGUI.h
+++ b/misc/memstat/inc/TMemStatViewerGUI.h
@@ -15,15 +15,19 @@
 //  used for the calibration monitor                                         //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
-#ifndef ALITPCCALIBVIEWERGUI
-#define ALITPCCALIBVIEWERGUI
+
+#ifndef ROOT_TMemStatViewerGUI
+#define ROOT_TMemStatViewerGUI
 
 // STD
 #include <string>
 #include <memory>
 // ROOT
+#ifndef ROOT_TGFrame
 #include "TGFrame.h"
+#endif
 
+class TMemStat;
 class TGTextView;
 class TGNumberEntry;
 class TGComboBox;
diff --git a/montecarlo/eg/inc/Hepevt.h b/montecarlo/eg/inc/Hepevt.h
index 864564d8b746eaceab1aeafd537a2a9ca06cdc98..eb0d168d3cdc5c5cbf4d4b47b8273c5b0f7db45e 100644
--- a/montecarlo/eg/inc/Hepevt.h
+++ b/montecarlo/eg/inc/Hepevt.h
@@ -11,6 +11,10 @@
 #ifndef ROOT_Hepevt
 #define ROOT_Hepevt
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 extern "C" {
 
 #ifndef __CFORTRAN_LOADED
diff --git a/net/auth/inc/AuthConst.h b/net/auth/inc/AuthConst.h
index 8f010b14d99b9bbf1e6d59b936e99f212db6eb67..fdb227336408f2380c036cf9358df6a676185bd1 100644
--- a/net/auth/inc/AuthConst.h
+++ b/net/auth/inc/AuthConst.h
@@ -20,6 +20,10 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
 // Number of security levels and masks
 const Int_t       kMAXSEC         = 6;
 const Int_t       kMAXSECBUF      = 4096;
diff --git a/proof/proofx/inc/TXHandler.h b/proof/proofx/inc/TXHandler.h
index 5daee54cd0bfb3d8758a366c9f311692d646abc0..42a225ac524cb58926ccee53a4c488536f94ed47 100644
--- a/proof/proofx/inc/TXHandler.h
+++ b/proof/proofx/inc/TXHandler.h
@@ -22,6 +22,11 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
+
 class TXHandler {
 
 public:
diff --git a/tree/tree/inc/TIndArray.h b/tree/tree/inc/TIndArray.h
index 5621cf5bda1c0e5c5b6e8ffdb8e7eeed6c5db1ce..d6fe7336434f8161ade4c1a63af4bbfe07f54d06 100644
--- a/tree/tree/inc/TIndArray.h
+++ b/tree/tree/inc/TIndArray.h
@@ -8,6 +8,11 @@
 #ifndef ROOT_TIndArray
 #define ROOT_TIndArray
 
+#ifndef ROOT_Rtypes
+#include "Rtypes.h"
+#endif
+
+
 class TIndArray
 {
    public:
@@ -37,7 +42,7 @@ class TIndArray
       UInt_t   fElems;     // Number of elements stored in the array
       UInt_t   fCapacity;  //!Capacity of the array
       UChar_t *fArr;       //[fElems] The array
-      
+
 };
 
 #endif // ROOT_TIndArray