diff --git a/LICENSE b/LICENSE
index 9d6597bf7113b3f9f0547bc941970cbcdf651148..feb8340938bfda50c357c17881363f6646c82d1f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -11,10 +11,6 @@ than OpenSSL.  If you modify this file, you may extend this exception
 to your version of the file, but you are not obligated to do so.  If you
 do not wish to do so, delete this exception statement from your version.
 
-3) Onion routing is patented (in the US only) by NRL, and you don't
-have a license. You should consult your lawyer to decide whether you
-need a license for this software.
-
 
 
 
diff --git a/Makefile.am b/Makefile.am
index d31d72e1621d37500db6277a40dd388750144da0..cbabcd86e0636a2ef4faece5c728e8a4015955ee 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
 
-SUBDIRS = src
+SUBDIRS = src doc
 
-DIST_SUBDIRS = src
+DIST_SUBDIRS = src doc
 
-EXTRA_DIST = LICENSE doc
+EXTRA_DIST = LICENSE
 
diff --git a/configure.in b/configure.in
index 8a6dcdfa1c45b730cfe5dc86fed708fe5a3603e8..d0dddc4acb8068f82f2536ca4f9f9cee5f794883 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
 
 AC_INIT
-AM_INIT_AUTOMAKE(tor, 0.0.2pre8)
+AM_INIT_AUTOMAKE(tor, 0.0.2pre9)
 AM_CONFIG_HEADER(orconfig.h)
 
 CFLAGS="-Wall -O2 -I/usr/kerberos/include"
@@ -159,5 +159,5 @@ AC_CHECK_SIZEOF(long)
 AC_CHECK_SIZEOF(long long)
 AC_CHECK_SIZEOF(__int64)
 
-AC_OUTPUT(Makefile src/Makefile src/common/Makefile src/or/Makefile)
+AC_OUTPUT(Makefile src/Makefile doc/Makefile src/config/Makefile src/common/Makefile src/or/Makefile)
 
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..5d4ab67610ee1d931b0b19e349c40813329b5723
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,3 @@
+
+EXTRA_DIST = tor-spec.txt CLIENTS FAQ HACKING rendezvous.txt tor-design.tex
+
diff --git a/src/Makefile.am b/src/Makefile.am
index 71370fa719b50a69dbe549521e0f754ba043fa79..ba296a6b0fdff08c7e409df09e41876c18e74235 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,6 @@
 
 # leave in dependency order, since common must be built first
 
-SUBDIRS =      common or
-DIST_SUBDIRS = common or
-EXTRA_DIST = config
+SUBDIRS =      common or config
+DIST_SUBDIRS = common or config
 
diff --git a/src/common/log.c b/src/common/log.c
index 70646201a8df24b9ad1f1835e6c792f778952915..a56a1e95be6ed256ae38ddd22243b4fabea2039e 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -103,7 +103,7 @@ log_set_severity(int severity)
 }
 
 /* Outputs a message to stdout */
-void log(int severity, const char *format, ...)
+void _log(int severity, const char *format, ...)
 {
   va_list ap;
   va_start(ap,format);
diff --git a/src/common/log.h b/src/common/log.h
index 9b9d072eec8878ec8eb85d1cd9fa71afe09ee6d5..8e0e5fc33d96ccaf0c2eea70ca24341722abcbd8 100644
--- a/src/common/log.h
+++ b/src/common/log.h
@@ -36,7 +36,7 @@ void close_logs();
 void reset_logs();
 
 /* Outputs a message to stdout */
-void log(int severity, const char *format, ...) CHECK_PRINTF(2,3);
+void _log(int severity, const char *format, ...) CHECK_PRINTF(2,3);
 
 #ifdef __GNUC__
 void _log_fn(int severity, const char *funcname, const char *format, ...)
@@ -44,8 +44,9 @@ void _log_fn(int severity, const char *funcname, const char *format, ...)
 #define log_fn(severity, args...) \
   _log_fn(severity, __PRETTY_FUNCTION__, args)
 #else
-#define log_fn log
+#define log_fn _log
 #endif
+#define log _log /* hack it so we don't conflict with log() as much */
 
 # define __LOG_H
 #endif
diff --git a/src/common/util.c b/src/common/util.c
index a4b2bd0b3882eac648cdf8ced2b0266d3f1c4362..c87665c25bfb49a7c4c3e7bce326b7d91b82b060 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -61,7 +61,6 @@ long
 tv_udiff(struct timeval *start, struct timeval *end)
 {
   long udiff;
-  long end_usec = end->tv_usec;
   long secdiff = end->tv_sec - start->tv_sec;
 
   if (secdiff+1 > LONG_MAX/1000000) {
@@ -69,9 +68,10 @@ tv_udiff(struct timeval *start, struct timeval *end)
     return LONG_MAX;
   }
 
-  udiff = secdiff*1000000L + (end_usec - start->tv_usec);
+  udiff = secdiff*1000000L + (end->tv_usec - start->tv_usec);
   if(udiff < 0) {
-    log_fn(LOG_WARNING, "start is after end. Returning 0.");
+    log_fn(LOG_INFO, "start (%ld.%ld) is after end (%ld.%ld). Returning 0.",
+           start->tv_sec, start->tv_usec, end->tv_sec, end->tv_usec);
     return 0;
   }
   return udiff;
diff --git a/src/common/util.h b/src/common/util.h
index 40e35d9629c3e7dd32fdd2ba6ebfbf54d27bd31e..358134bedf8d965a51b8d7917f78270283ac1145 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -32,6 +32,7 @@
 #define INLINE inline
 #endif
 
+#define xfree(p) do {if(p) {free(p); (p)=NULL;}} while(0) /* XXX use everywhere? */
 void *tor_malloc(size_t size);
 char *tor_strdup(const char *s);
 void tor_gettimeofday(struct timeval *timeval);
diff --git a/src/or/connection.c b/src/or/connection.c
index bc906492038a256b5f48e70945acab6e4e1f1e78..b893a51861114bc8c3025afd396870df529a77cd 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -351,8 +351,6 @@ int connection_read_to_buf(connection_t *conn) {
       at_most = 10*(CELL_PAYLOAD_SIZE - RELAY_HEADER_SIZE);
     }
 
-    at_most = 103; /* an unusual number, to force bugs into the open */
-
     if(at_most > global_read_bucket)
       at_most = global_read_bucket;
   }
diff --git a/src/or/or.h b/src/or/or.h
index a50f2002f544b55b5952efc4882be97d111133c8..c499982bb3bc466a0277de9c0eb452a17d2a6421 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -95,7 +95,7 @@
 #include "../common/log.h"
 #include "../common/util.h"
 
-#define RECOMMENDED_SOFTWARE_VERSIONS "0.0.2pre8,0.0.2pre9"
+#define RECOMMENDED_SOFTWARE_VERSIONS "0.0.2pre8,0.0.2pre9,0.0.2pre10"
 
 #define MAXCONNECTIONS 1000 /* upper bound on max connections.
                               can be lowered by config file */