diff --git a/src/colvar/PathMSDBase.cpp b/src/colvar/PathMSDBase.cpp
index 69a691108b2e8d2434246b28163b55f454143e67..8aa380520af320806091aa690d2b8f2eef9bdfbf 100644
--- a/src/colvar/PathMSDBase.cpp
+++ b/src/colvar/PathMSDBase.cpp
@@ -20,19 +20,13 @@
    along with plumed.  If not, see <http://www.gnu.org/licenses/>.
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
 #include <cmath>
-
 #include "Colvar.h"
 #include "PathMSDBase.h"
 #include "ActionRegister.h"
-
 #include "core/PlumedMain.h"
-
-#include <string>
-#include <cstring>
-#include <iostream>
+#include "core/Atoms.h"
 #include "tools/PDB.h"
 #include "tools/RMSD.h"
-#include "core/Atoms.h"
 #include "tools/Tools.h"
 
 using namespace std;
diff --git a/src/colvar/PathMSDBase.h b/src/colvar/PathMSDBase.h
index 62e80ba17940c5c38e6cc5045e30c2791a81dfa1..128b7907327f350fa63043f88482cb909f5e0e3f 100644
--- a/src/colvar/PathMSDBase.h
+++ b/src/colvar/PathMSDBase.h
@@ -27,9 +27,6 @@
 #include "Colvar.h"
 #include "ActionRegister.h"
 
-#include <string>
-#include <cstring>
-#include <iostream>
 #include "tools/PDB.h"
 #include "tools/RMSD.h"
 #include "tools/Tools.h"
diff --git a/src/tools/Log.h b/src/tools/Log.h
index b75ca716885983a741e88b7da6e58b1aeaf898e9..b2c3a832200e0020b23d0f78f6409e87e6373548 100644
--- a/src/tools/Log.h
+++ b/src/tools/Log.h
@@ -22,10 +22,6 @@
 #ifndef __PLUMED_tools_Log_h
 #define __PLUMED_tools_Log_h
 
-#include <cstdio>
-#include <string>
-#include <sstream>
-
 #include "File.h"
 
 namespace PLMD{
diff --git a/src/tools/PDB.h b/src/tools/PDB.h
index fcf0b052bbdc600608d48b182d1c5b0e17510bcc..661ee1ee5bf80fb07f87651c9fb887b6fb767c2e 100644
--- a/src/tools/PDB.h
+++ b/src/tools/PDB.h
@@ -26,7 +26,6 @@
 #include "Vector.h"
 #include <vector>
 #include <string>
-#include <iostream>
 #include "Log.h"