diff --git a/.gitattributes b/.gitattributes
index 6d5fc39814929230d55673624e12381d0ac6411d..19660e09079d92f72713053dbeb5c05dc32549b0 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -345,7 +345,6 @@ testfont binary
 /src/bignum.h foreign_ident
 /src/block_alloc.h foreign_ident
 /src/block_alloc_h.h foreign_ident
-/src/builtin.cmod foreign_ident
 /src/builtin_functions.c foreign_ident
 /src/builtin_functions.h foreign_ident
 /src/callback.c foreign_ident
@@ -372,7 +371,6 @@ testfont binary
 /src/crypt.c foreign_ident
 /src/cyclic.c foreign_ident
 /src/cyclic.h foreign_ident
-/src/dlopen.c foreign_ident
 /src/dmalloc.h foreign_ident
 /src/docode.h foreign_ident
 /src/dumpmaster.pike foreign_ident
@@ -393,12 +391,10 @@ testfont binary
 /src/fsort.c foreign_ident
 /src/fsort.h foreign_ident
 /src/fsort_template.h foreign_ident
-/src/gc.c foreign_ident
 /src/gc.h foreign_ident
 /src/hashtable.c foreign_ident
 /src/hashtable.h foreign_ident
 /src/install-sh foreign_ident
-/src/interpret.c foreign_ident
 /src/interpret.h foreign_ident
 /src/interpreter.h foreign_ident
 /src/iterators.cmod foreign_ident
@@ -768,7 +764,6 @@ testfont binary
 /src/modules/system/system.c foreign_ident
 /src/modules/system/system.h foreign_ident
 /src/modules/system/testsuite.in foreign_ident
-/src/multiset.c foreign_ident
 /src/multiset.h foreign_ident
 /src/object.c foreign_ident
 /src/object.h foreign_ident
@@ -793,7 +788,6 @@ testfont binary
 /src/pike_memory.h foreign_ident
 /src/pike_netlib.h foreign_ident
 /src/pike_rusage.h foreign_ident
-/src/pike_search.c foreign_ident
 /src/pike_search.h foreign_ident
 /src/pike_search_engine.c foreign_ident
 /src/pike_search_engine2.c foreign_ident
@@ -825,7 +819,6 @@ testfont binary
 /src/post_modules/GSSAPI/Makefile.in foreign_ident
 /src/post_modules/GSSAPI/acconfig.h foreign_ident
 /src/post_modules/GSSAPI/configure.in foreign_ident
-/src/post_modules/GSSAPI/gssapi.cmod foreign_ident
 /src/post_modules/GTK/acconfig.h foreign_ident
 /src/post_modules/GTK/dummy.c foreign_ident
 /src/post_modules/GTK/gdkeventstrings.h foreign_ident
@@ -842,13 +835,10 @@ testfont binary
 /src/post_modules/GTK2/source/support.c foreign_ident
 /src/post_modules/Makefile.in foreign_ident
 /src/post_modules/Nettle/Makefile.in foreign_ident
-/src/post_modules/Nettle/cipher.cmod foreign_ident
 /src/post_modules/Nettle/configure.in foreign_ident
 /src/post_modules/Nettle/crypt_md5.c foreign_ident
-/src/post_modules/Nettle/hash.cmod foreign_ident
 /src/post_modules/Nettle/idea.c foreign_ident
 /src/post_modules/Nettle/idea.h foreign_ident
-/src/post_modules/Nettle/nettle.cmod foreign_ident
 /src/post_modules/Nettle/nt.cmod foreign_ident
 /src/post_modules/Nettle/rijndaeltest.pike foreign_ident
 /src/post_modules/SDL/Makefile.in foreign_ident
@@ -900,7 +890,6 @@ testfont binary
 /src/program_id.h foreign_ident
 /src/queue.c foreign_ident
 /src/queue.h foreign_ident
-/src/rbtree.c foreign_ident
 /src/rbtree.h foreign_ident
 /src/rbtree_low.h foreign_ident
 /src/run_autoconfig foreign_ident
diff --git a/src/builtin.cmod b/src/builtin.cmod
index b9f779e10f063b27a07150fd5c391b3a49951dc2..66aa993d34a2e643a522b8ef06db2fc3ac1938f2 100644
--- a/src/builtin.cmod
+++ b/src/builtin.cmod
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: builtin.cmod,v 1.259 2010/06/22 09:24:35 mast Exp $
+|| $Id$
 */
 
 #include "global.h"
@@ -32,7 +32,6 @@
 #include "block_alloc.h"
 #include "pikecode.h"
 
-#include <assert.h>
 #include <ctype.h>
 #include <errno.h>
 #include <math.h>
diff --git a/src/dlopen.c b/src/dlopen.c
index 9561c925bf068540c7f96b026d233038d26efda0..cce4b5f992735a4bd03f8c4f1666a10650874957 100644
--- a/src/dlopen.c
+++ b/src/dlopen.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: dlopen.c,v 1.76 2006/07/05 19:06:46 mast Exp $
+|| $Id$
 */
 
 /* Note: This is not used if --enable-dll is. */
@@ -25,7 +25,6 @@
 #include <windows.h>
 #include <memory.h>
 #include <sys/stat.h>
-#include <assert.h>
 #include <math.h>
 #include <tchar.h>
 #include <interpret.h>
diff --git a/src/gc.c b/src/gc.c
index 471488366e30ee276459d1c5f74729e5b33ef59c..774a81078852a3a91e1648faab8fa65a1ccc9433 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: gc.c,v 1.351 2010/07/15 22:31:18 mast Exp $
+|| $Id$
 */
 
 #include "global.h"
@@ -30,7 +30,6 @@ struct callback *gc_evaluator_callback=0;
 #include "main.h"
 
 #include <math.h>
-#include <assert.h>
 
 #include "block_alloc.h"
 
diff --git a/src/global.h b/src/global.h
index 7b7dbcf429d6a5c48e179b91376b5941fb2c9c66..5bf8caf7196b5499bb5a556443ed75b7f7385e32 100644
--- a/src/global.h
+++ b/src/global.h
@@ -540,6 +540,8 @@ typedef struct p_wchar_p
 
 #endif	/* !PIKE_DEBUG */
 
+#include <assert.h>
+
 #if defined (PIKE_DEBUG) || defined (DO_PIKE_CLEANUP)
 #define DO_IF_DEBUG_OR_CLEANUP(X) X
 #else
diff --git a/src/interpret.c b/src/interpret.c
index 15a14e0d6e633cee88fdf7c6d77e006c5ff70460..c785cb0dbefc199181612053343652d6d1e92eba 100644
--- a/src/interpret.c
+++ b/src/interpret.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: interpret.c,v 1.414 2010/01/21 15:39:58 grubba Exp $
+|| $Id$
 */
 
 #include "global.h"
@@ -38,7 +38,6 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <ctype.h>
-#include <assert.h>
 
 #ifdef HAVE_MMAP
 #ifdef HAVE_SYS_TYPES_H
diff --git a/src/multiset.c b/src/multiset.c
index 6d28e68d936f2b24a75e39a786d002b12fb88697..2ebd755d6f350a068bbf6b52375da06acaf7dee8 100644
--- a/src/multiset.c
+++ b/src/multiset.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: multiset.c,v 1.122 2010/07/19 15:49:25 mast Exp $
+|| $Id$
 */
 
 #include "global.h"
@@ -36,8 +36,6 @@
  * objects are involved!) Well.. Although cheap I suspect it pays off
  * so extremely seldom that it isn't worth it. /mast */
 
-#include <assert.h>
-
 #define sp Pike_sp
 
 /* The following defines the allocation policy. It's almost the same
diff --git a/src/pike_search.c b/src/pike_search.c
index 41627ef3b3cdade50b31a10b2abf7610bf7c84b4..2a2c1f9d57119426f8ea6303c87927299da1b0f4 100644
--- a/src/pike_search.c
+++ b/src/pike_search.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: pike_search.c,v 1.31 2008/06/29 12:37:10 nilsson Exp $
+|| $Id$
 */
 
 /* New memory searcher functions */
@@ -20,8 +20,6 @@
 #include "pike_search.h"
 #include "bignum.h"
 
-#include <assert.h>
-
 ptrdiff_t pike_search_struct_offset;
 #define OB2MSEARCH(O) ((struct pike_mem_searcher *)((O)->storage+pike_search_struct_offset))
 #define THIS_MSEARCH ((struct pike_mem_searcher *)(Pike_fp->current_storage))
diff --git a/src/post_modules/GSSAPI/gssapi.cmod b/src/post_modules/GSSAPI/gssapi.cmod
index 02b87f98faa8800b0969886f72e07fcc60b95ac0..f6346c0fcba1c8beac7756b4ec1cf35f4dd5d53f 100644
--- a/src/post_modules/GSSAPI/gssapi.cmod
+++ b/src/post_modules/GSSAPI/gssapi.cmod
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: gssapi.cmod,v 1.12 2008/08/11 17:37:34 mast Exp $
+|| $Id$
 */
 
 /*
@@ -36,8 +36,6 @@
 #include "global.h"
 #include "gssapi_config.h"
 
-#include <assert.h>
-
 #include "bignum.h"
 #include "builtin_functions.h"
 #include "dmalloc.h"
diff --git a/src/post_modules/Nettle/cipher.cmod b/src/post_modules/Nettle/cipher.cmod
index 52eeda6f420ba57d34af5b2c39c99baf8b969c95..7e099d13689d7eeb01d1f873f41fcf049b1333d9 100644
--- a/src/post_modules/Nettle/cipher.cmod
+++ b/src/post_modules/Nettle/cipher.cmod
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: cipher.cmod,v 1.41 2009/07/02 16:35:38 grubba Exp $
+|| $Id$
 */
 
 #include "global.h"
@@ -38,7 +38,6 @@ DECLARATIONS
 #include "idea.h"
 #include <nettle/nettle-meta.h>
 
-#include <assert.h>
 #include <stdio.h>
 #include <stdarg.h>
 
diff --git a/src/post_modules/Nettle/hash.cmod b/src/post_modules/Nettle/hash.cmod
index 1e59e2c7559ba7b4c48b4a24e845b2aca1ebb487..7b5e0d4deb7014c135714284642a439c630fe7a3 100644
--- a/src/post_modules/Nettle/hash.cmod
+++ b/src/post_modules/Nettle/hash.cmod
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: hash.cmod,v 1.35 2010/06/21 12:35:35 mast Exp $
+|| $Id$
 */
 
 #include "global.h"
@@ -30,7 +30,6 @@ DECLARATIONS
 #include <nettle/sha.h>
 #include <nettle/nettle-meta.h>
 
-#include <assert.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include "fdlib.h"
diff --git a/src/post_modules/Nettle/nettle.cmod b/src/post_modules/Nettle/nettle.cmod
index b71225564bc00f973c88b9b46c6f86f2fbff9545..0dab1cbfb2144d43d844a3aae70793ac2373d410 100644
--- a/src/post_modules/Nettle/nettle.cmod
+++ b/src/post_modules/Nettle/nettle.cmod
@@ -1,5 +1,5 @@
 /* nettle.cmod -*- c -*- */
-/* $Id: nettle.cmod,v 1.58 2010/06/22 14:30:13 grubba Exp $ */
+/* $Id$ */
 
 #include "global.h"
 #include "interpret.h"
@@ -19,7 +19,6 @@
 #include <nettle/yarrow.h>
 #include <nettle/knuth-lfib.h>
 
-#include <assert.h>
 #include <stdio.h>
 #include <stdarg.h>
 
diff --git a/src/rbtree.c b/src/rbtree.c
index 8bdf97389c4afc6ef63f088fac2d2ea5cd685784..404e7d9c6c6e6ac43ff197f50615d56d4946df0e 100644
--- a/src/rbtree.c
+++ b/src/rbtree.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: rbtree.c,v 1.26 2009/04/06 00:34:16 mast Exp $
+|| $Id$
 */
 
 /* An implementation of a threaded red/black balanced binary tree.
@@ -16,7 +16,6 @@
 #include "pike_error.h"
 #include "rbtree_low.h"
 
-#include <assert.h>
 #include <stdlib.h>
 
 #if defined (PIKE_DEBUG) || defined (TEST_MULTISET)
diff --git a/src/threads.c b/src/threads.c
index 5766dcae3d9261a2cb8bc6648984f2bb5bf774d2..aa8267d9686661bef583477db53a4d940c17893d 100644
--- a/src/threads.c
+++ b/src/threads.c
@@ -38,7 +38,6 @@
 #include "backend.h"
 #include "pike_rusage.h"
 
-#include <assert.h>
 #include <errno.h>
 
 #ifdef HAVE_SYS_PRCTL_H