diff -ruN klic-3.003-2002-02-06a/compiler/klicdb.c klic-3.003-2002-02-06b/compiler/klicdb.c
--- klic-3.003-2002-02-06a/compiler/klicdb.c	Wed Feb  6 16:16:45 2002
+++ klic-3.003-2002-02-06b/compiler/klicdb.c	Wed Feb  6 22:06:05 2002
@@ -4,6 +4,7 @@
 %   (C)1996, 1997, 1998, 1999 Japan Information Processing Development Center
 %       (Read COPYRIGHT-JIPDEC for detailed information.)
 ----------------------------------------------------------- */
+
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
@@ -17,6 +18,7 @@
 #include <fcntl.h>
 #endif
 #include <assert.h>
+#include <klic/atomstuffs.h>  /* ATOMNUMBERBASE */
 
 extern void* malloc();
 
@@ -499,6 +501,21 @@
 
 #define TEMPDBNAME  ".klic.db"
 
+static void
+print_atom(FILE* atomh, FILE* atomc, unsigned char* name, int id)
+{
+  unsigned char realname[BUFSIZE];
+  if(! nocfiles){
+    fprintf(atomh, "#define atom_%s %dL\n", name, id);
+
+    real_atom_name(name, realname);
+    putc('\t', atomc);
+    print_c_string(atomc, realname);
+    putc(',', atomc);
+    putc('\n', atomc);
+  }
+}
+
 static write_db_files(
   time_t inittime )
 {
@@ -520,20 +537,13 @@
       "#include <klic/atomstuffs.h>  /* init_atomname */\n" \
       "#include <klic/basic.h>\n\n" \
       "unsigned char* const init_atomname[] = {\n" );
+    print_atom(atomh, atomc, "_5B_5D", 0);  /* [] */
+    print_atom(atomh, atomc, "_2E", 1);     /* .  */
   }
 
   for (a=atomroot; a!=NULL; a=a->next) {
-    unsigned char realname[BUFSIZE];
-    real_atom_name(a->name, realname);
-    if (!nocfiles) {
-      (void) fprintf(atomh, "#define atom_%s %dL+ATOMNUMBERBASE\n",
-		    a->name, a->id);
-      (void) putc('\t', atomc);
-      print_c_string(atomc, realname);
-      (void) putc(',', atomc);
-      (void) putc('\n', atomc);
-    }
-    (void) fprintf(newdb, "atom_%s\n", a->name);
+    print_atom(atomh, atomc, a->name, a->id);
+    fprintf(newdb, "atom_%s\n", a->name);
   }
   assert(a == NULL);
 
@@ -562,7 +572,7 @@
       (void) fprintf(functh, "#define functor_%s_%d\t%dL+FUNCTORNUMBERBASE\n",
 		    f->principal_functor->name, f->arity,
 		    f->id);
-      (void) fprintf(functc, "\t%dL+ATOMNUMBERBASE,\n",
+      (void) fprintf(functc, "\t%dL,\n",
 		    f->principal_functor->id);
     }
     (void) fprintf(newdb, "functor_%s_%d\n",
@@ -804,7 +814,7 @@
     usage_error(argv[0]);
   }
 
-  atomroot = NULL; nextatom = 0;
+  atomroot = NULL; nextatom = ATOMNUMBERBASE;
   functroot = NULL; nextfunct = 0;
   currentmod.name = NULL;
 
diff -ruN klic-3.003-2002-02-06a/runtime/newatom.c klic-3.003-2002-02-06b/runtime/newatom.c
--- klic-3.003-2002-02-06a/runtime/newatom.c	Wed Feb  6 17:12:01 2002
+++ klic-3.003-2002-02-06b/runtime/newatom.c	Wed Feb  6 22:03:57 2002
@@ -140,7 +140,7 @@
   long index, hashvalue;
 
   hashvalue =
-    ((long) (a_no - ATOMNUMBERBASE + arity)) % functhp->hashtablesize;
+    ((long) (a_no + arity)) % functhp->hashtablesize;
 
   index = functhp->table[hashvalue]-1;
   if( index >= 0 ){
@@ -257,7 +257,7 @@
 #ifdef SHM
 	s_unlock(a_key());
 #endif
-	return atomhp->atomid + ATOMNUMBERBASE;
+	return atomhp->atomid;
       }else{
 	index = index0;
       }
@@ -265,7 +265,7 @@
 #ifdef SHM
     s_unlock(a_key());
 #endif
-    return index + ATOMNUMBERBASE;
+    return index;
   }else{
     if( atomhp->atomid +1 == atomhp->nametablesize ){
       goto expand;
@@ -283,7 +283,7 @@
 #ifdef SHM
     s_unlock(a_key());
 #endif
-    return atomhp->atomid + ATOMNUMBERBASE;
+    return atomhp->atomid;
   }
 
  expand:
@@ -334,7 +334,7 @@
   if( init_functor ) make_functor_table();
 
   hashvalue =
-    ((long)(a_no - ATOMNUMBERBASE + arity)) % functhp->hashtablesize;
+    ((long)(a_no + arity)) % functhp->hashtablesize;
 
 #ifdef SHM
   s_lock(f_key());
@@ -419,10 +419,9 @@
 {
   unsigned long size =
     (atomhp->nametablesize > 0 ? atomhp->nametablesize : initial_atoms);
-  unsigned long i = id - ATOMNUMBERBASE;
 
-  if (i >= size)
-    fatalf("atomname: id %d > %d", i, size);
+  if (id >= size)
+    fatalf("atomname: id %d > %d", id, size);
 
-  return atomnames[i];
+  return atomnames[id];
 }
