Index: patterns/eyes.h
===================================================================
--- patterns/eyes.h	(revision 2407)
+++ patterns/eyes.h	(working copy)
@@ -34,16 +34,16 @@
  */
 
 struct eye_vertex {
-  char marginal;		  /* 1 if marginal vertex, 0 otherwise    */
-  char edge;			  /* 0 = center, 1 = edge, 2 = corner	   */
+  signed char marginal;		  /* 1 if marginal vertex, 0 otherwise     */
+  signed char edge;		  /* 0 = center, 1 = edge, 2 = corner	   */
   /* A corner vertex may only be matched at the corner.
    * An edge vertex may be matched at the corner or on the edge.
    * A center vertex may be matched anywhere.
    */
-  char flags;			  /* see the #defines above		   */
+  signed char flags;		  /* see the #defines above		   */
 
-  char neighbors;		  /* number of neighbors                   */
-  int n[4];			  /* position in array of vertex neighors */
+  signed char neighbors;	  /* number of neighbors                   */
+  signed char n[4];		  /* position in array of vertex neighbors */
 };
 
 
@@ -54,7 +54,7 @@
 
 struct eye_graph {
   struct eye_vertex *vertex;
-  int patnum;			  /* Number of pattern			    */
+  int patnum;			  /* number of pattern			   */
   int esize;                      /* number of vertices                    */
   int msize;                      /* number of marginal vertices           */
   int ends;                       /* number of vertices with one neighbor  */
Index: patterns/patterns.db
===================================================================
--- patterns/patterns.db	(revision 2407)
+++ patterns/patterns.db	(working copy)
@@ -7349,12 +7349,12 @@
 
 :8,OE
 
+?O...?
+?..*.?
 ?a...?
-?..*.?
-?b...?
 ??????
 
-;xarea(*) && oarea(b)
+;xarea(*) && oarea(a)
 
 
 Pattern CB106
Index: patterns/uncompress_fuseki.c
===================================================================
--- patterns/uncompress_fuseki.c	(revision 2407)
+++ patterns/uncompress_fuseki.c	(working copy)
@@ -101,9 +101,9 @@
 #define C_HEADER "struct fullboard_pattern fuseki%d[] = {\n"
 #define C_FOOTER "};\n"
   
-const char *const db_output_strings[3] =
+static const char *const db_output_strings[3] =
   {DB_PREAMBLE, DB_HEADER, DB_FOOTER};
-const char *const c_output_strings[3] =
+static const char *const c_output_strings[3] =
   {C_PREAMBLE, C_HEADER, C_FOOTER};
 
 #define PREAMBLE 	0
Index: patterns/mkeyes.c
===================================================================
--- patterns/mkeyes.c	(revision 2407)
+++ patterns/mkeyes.c	(working copy)
@@ -26,7 +26,6 @@
 /* see also eyes.db, eyes.h and engine/optics.c */
 
 
-#define MAX_BOARD 19
 #define MAXLINE 80
 #define MAXDIMEN 20
 #define MAXSIZE 20
Index: doc/using.texi
===================================================================
--- doc/using.texi	(revision 2407)
+++ doc/using.texi	(working copy)
@@ -541,8 +541,7 @@
 @option{-l} and @option{-L} to create a diagram of the board from
 another sgf file. Illegal moves are indicated with the private
 @code{IL} property.  This property is not used in the FF4 SGF
-specification, so we are free to preempt it. This feature is used
-in the CGI interface in @file{interface/html/gg.cgi}.  
+specification, so we are free to preempt it.
 @end quotation
 @item @option{--options}
 @quotation 
@@ -621,7 +620,7 @@
 depth (default 13), GNU Go still tries to attack strings with only
 3 liberties, but only tries one move at each node.
 @end quotation
-@item @option{--break_chain-cutoff @var{depth}}
+@item @option{--break-chain-depth @var{depth}}
 @quotation
 Set the @code{break_chain_depth}. Beyond this depth, GNU Go abandons
 some attempts to defend groups by trying to capture part of the surrounding
Index: doc/introduction.texi
===================================================================
--- doc/introduction.texi	(revision 2407)
+++ doc/introduction.texi	(working copy)
@@ -57,8 +57,7 @@
 by the Free Software Foundation except as noted below.
 
 All files are under the GNU General Public License (@pxref{GPL}),
-except @file{gmp.c}, @file{gmp.h}, @file{gtp.c}, @file{gtp.h}, the files 
-@file{interface/html/*} and @file{win/makefile.win}.
+except @file{gmp.c}, @file{gmp.h}, @file{gtp.c}, and @file{gtp.h}.
 
 The files @file{gtp.c} and @file{gtp.h} are copyright the Free Software
 Foundation. In the interests of promoting the Go Text Protocol these
@@ -68,11 +67,6 @@
 The two files @file{gmp.c} and @file{gmp.h} were placed in the public domain
 by William Shubert, their author, and are free for unrestricted use.
 
-The files @file{interface/html/*} are not part of GNU Go but are a separate
-program and are included in the distribution for the convenience of anyone
-looking for a CGI interface to GNU Go. They were placed in the public domain
-by their author, Douglas Ridgway, and are free for unrestricted use.
-
 The files @file{regression/games/golois/*sgf} are copyright Tristan
 Cazenave and are included with his permission.
 
Index: configure.in
===================================================================
--- configure.in	(revision 2407)
+++ configure.in	(working copy)
@@ -49,9 +49,9 @@
 dnl and look to see if they want to disable the grid optimisation
 
 AC_ARG_ENABLE(grid-opt,
- [  --enable-grid-opt           enable the grid optimsation within the pattern
+ [  --enable-grid-opt           enable the grid optimisation within the pattern
                                 matcher (default)
-  --enable-grid-opt=distrust  enable the grid optimsation in non-trusting mode
+  --enable-grid-opt=distrust  enable the grid optimisation in non-trusting mode
   --disable-grid-opt          disable the grid optimisation])
 
 default_cache_size=-1
Index: README
===================================================================
--- README	(revision 2407)
+++ README	(working copy)
@@ -231,11 +231,6 @@
 * The files gmp.c and gmp.h are copyright Bill Shubert. These
   are free for unrestricted use.
 
-* The files interface/html/* are not part of GNU Go but are a separate
-  probram and are included in the distribution for the convenience of anyone
-  looking for a CGI interface to GNU Go. They were placed in the public domain
-  by their author, Douglas Ridgway, and are free for unrestricted use.
-
 * The files regression/golois/* and the tests vie.tst, connect.tst,
   capture.tst and global.tst are copyright Tristan Cazenave and are
   used with his permission
Index: interface/gtp_examples/twogtp.pike
===================================================================
--- interface/gtp_examples/twogtp.pike	(revision 2407)
+++ interface/gtp_examples/twogtp.pike	(working copy)
@@ -758,7 +758,7 @@
 
 	if (move_lower_case == "pass") {
 	  if (verbose)
-	    werror(player->capitalized_color + " passes\n");
+	    werror("play " + player->capitalized_color + " pass\n");
 
 	  if (++passes == 2)
 	    break;
@@ -769,7 +769,7 @@
 	    if (time_left == " ()")
 	      time_left = "";
 
-	    werror("%s plays %s%s\n", player->capitalized_color,
+	    werror("play %s %s%s\n", player->capitalized_color,
 		   move, time_left);
 	  }
 
Index: interface/play_ascii.c
===================================================================
--- interface/play_ascii.c	(revision 2407)
+++ interface/play_ascii.c	(working copy)
@@ -951,7 +951,7 @@
 	  tmpstring = strtok(NULL, " ");
 	  if (tmpstring) {
 	    /* discard newline */
-	    tmpstring[strlen(tmpstring)-1] = 0;
+	    tmpstring[strlen(tmpstring) - 1] = 0;
 	    /* make sure we are saving proper handicap */
 	    init_sgf(gameinfo);
 	    writesgf(sgftree.root, tmpstring);
@@ -968,7 +968,7 @@
 	  tmpstring = strtok(NULL, " ");
 	  if (tmpstring) {
 	    /* discard newline */
-	    tmpstring[strlen(tmpstring)-1] = 0;
+	    tmpstring[strlen(tmpstring) - 1] = 0;
 	    if (!sgftree_readfile(&sgftree, tmpstring)) {
 	      fprintf(stderr, "Cannot open or parse '%s'\n", tmpstring);
 	      break;
@@ -1070,7 +1070,7 @@
       tmpstring = strtok(NULL, " ");
       if (tmpstring) {
 	/* discard newline */
-	tmpstring[strlen(tmpstring)-1] = 0;
+	tmpstring[strlen(tmpstring) - 1] = 0;
 	init_sgf(gameinfo);
 	writesgf(sgftree.root, tmpstring);
       }
@@ -1160,7 +1160,7 @@
       if (pos == NO_MOVE || board[pos] == EMPTY)
 	printf("\ninvalid!\n");
       else {
-	int status = dragon_status(pos);
+	enum dragon_status status = dragon_status(pos);
 	status = (status == DEAD) ? ALIVE : DEAD;
 	change_dragon_status(pos, status);
 	ascii_showboard();
Index: interface/play_gtp.c
===================================================================
--- interface/play_gtp.c	(revision 2407)
+++ interface/play_gtp.c	(working copy)
@@ -2002,10 +2002,10 @@
   owl_analyze_semeai(dragona, dragonb, &resulta, &resultb, &move, 0,
                      &result_certain);
   gtp_start_response(GTP_SUCCESS);
-  gtp_mprintf("%s %s %m", 
-	      status_to_string(resulta),
-	      status_to_string(resultb),
-	      I(move), J(move));
+  gtp_print_code(resulta);
+  gtp_printf(" ");
+  gtp_print_code(resultb);
+  gtp_mprintf(" %m", I(move), J(move));
   if (!result_certain && report_uncertainty)
     gtp_printf(" uncertain");
 
Index: interface/main.c
===================================================================
--- interface/main.c	(revision 2407)
+++ interface/main.c	(working copy)
@@ -231,7 +231,7 @@
   {"backfill-depth", required_argument, 0, 'B'},
   {"branch-depth",   required_argument, 0, OPT_BRANCH_DEPTH},
   {"backfill2-depth",   required_argument, 0, OPT_BACKFILL2_DEPTH},
-  {"break_chain-depth", required_argument, 0, OPT_BREAK_CHAIN_DEPTH},
+  {"break-chain-depth", required_argument, 0, OPT_BREAK_CHAIN_DEPTH},
   {"superstring-depth", required_argument, 0, OPT_SUPERSTRING_DEPTH},
   {"fourlib-depth",  required_argument, 0, 'F'},
   {"ko-depth",       required_argument, 0, 'K'},
@@ -391,6 +391,10 @@
 	break;
 	
       case 'o':
+	if (strlen(gg_optarg) >= sizeof(outfilename)) {
+	  fprintf(stderr, "Too long filename given as value to -o option.\n");
+	  exit(EXIT_FAILURE);
+	}
 	outfile = gg_optarg;
 	strcpy(outfilename, gg_optarg);
 	break;
@@ -475,7 +479,7 @@
 		  "configure option enabled: owl threats\n");
 	if (RESIGNATION_ALLOWED)
 	  fprintf(stdout,
-		  "configure option enabled: resination allowed\n");
+		  "configure option enabled: resignation allowed\n");
 	if (ORACLE)
 	  fprintf(stdout,
 		  "configure option enabled: oracle\n");
@@ -1749,7 +1753,7 @@
   }
 
   if (! *address_pointer) {
-    fprintf(stderr, "Failed to connect to %s:%d\n", host_data->h_name, port);
+    fprintf(stderr, "Failed to connect to %s:%u\n", host_data->h_name, port);
     closesocket(connection_socket);
     exit(EXIT_FAILURE);
   }
@@ -1809,11 +1813,11 @@
 
   if (verbose) {
     if (host_name) {
-      fprintf(stderr, "Waiting for a connection on %s:%d...\n",
+      fprintf(stderr, "Waiting for a connection on %s:%u...\n",
 	      host_name, port);
     }
     else
-      fprintf(stderr, "Waiting for a connection on port %d...\n", port);
+      fprintf(stderr, "Waiting for a connection on port %u...\n", port);
   }
 
   if (bind(listening_socket,
@@ -1821,9 +1825,9 @@
       || listen(listening_socket, 0) == -1
       || (connection_socket = accept(listening_socket, NULL, NULL)) == -1) {
     if (host_name)
-      fprintf(stderr, "Failed to listen on %s:%d\n", host_name, port);
+      fprintf(stderr, "Failed to listen on %s:%u\n", host_name, port);
     else
-      fprintf(stderr, "Failed to listen on port %d\n", port);
+      fprintf(stderr, "Failed to listen on port %u\n", port);
 
     closesocket(listening_socket);
     exit(EXIT_FAILURE);
Index: utils/gg_utils.c
===================================================================
--- utils/gg_utils.c	(revision 2407)
+++ utils/gg_utils.c	(working copy)
@@ -246,28 +246,19 @@
  * if available, otherwise substituting a workaround for portability.
  */
 
-static int
-gg_gettimeofday2(struct timeval *tv)
+double
+gg_gettimeofday(void)
 {
+  struct timeval tv;
 #ifdef HAVE_GETTIMEOFDAY
-  return gettimeofday(tv, NULL);
+  gettimeofday(&tv, NULL);
 #else
-  if (tv != NULL) {
-    tv->tv_sec  = time(NULL);
-    tv->tv_usec = 0;
-  }
-  return 1;
+  tv->tv_sec  = time(NULL);
+  tv->tv_usec = 0;
 #endif
+  return tv.tv_sec + 1.e-6 * tv.tv_usec;
 }
 
-double
-gg_gettimeofday(void)
-{
-  struct timeval tv;
-  gg_gettimeofday2(&tv);
-  return tv.tv_sec + 1.e-6*tv.tv_usec;
-}
-
 const char *
 gg_version(void)
 {
Index: engine/interface.c
===================================================================
--- engine/interface.c	(revision 2407)
+++ engine/interface.c	(working copy)
@@ -191,7 +191,7 @@
     *upper = white_score;
   if (lower != NULL)
     *lower = black_score;
-  return ((white_score + black_score)/2.0);
+  return ((white_score + black_score) / 2.0);
 }
 
 
Index: engine/utils.c
===================================================================
--- engine/utils.c	(revision 2407)
+++ engine/utils.c	(working copy)
@@ -40,7 +40,7 @@
  */
 
 void
-change_dragon_status(int dr, int status)
+change_dragon_status(int dr, enum dragon_status status)
 {
   int pos;
   int origin = dragon[dr].origin;
Index: engine/owl.c
===================================================================
--- engine/owl.c	(revision 2407)
+++ engine/owl.c	(working copy)
@@ -315,7 +315,7 @@
     			   int goal_worm[MAX_GOAL_WORMS]);
 
 /* FIXME: taken from move_reasons.h */
-#define MAX_DRAGONS       2*MAX_BOARD*MAX_BOARD/3
+#define MAX_DRAGONS       2 * MAX_BOARD * MAX_BOARD / 3
 
 static int dragon_goal_worms[MAX_DRAGONS][MAX_GOAL_WORMS];
 
@@ -2759,7 +2759,7 @@
   current_owl_data = owl;
   memset(owl->safe_move_cache, 0, sizeof(owl->safe_move_cache));
 
-  /* First see whether we might already be alife. */
+  /* First see whether we might already be alive. */
   if (escape < MAX_ESCAPE) {
     if (owl_estimate_life(owl, NULL, vital_moves, &live_reason, 0,
 	  		  &probable_eyes, &eyemin, &eyemax)) {
@@ -4939,7 +4939,7 @@
   count_variations = 0;
   
   if (same_dragon == SAME_DRAGON_NOT_CONNECTED)
-    num_stones = findstones(pos, MAX_BOARD*MAX_BOARD, stones);
+    num_stones = findstones(pos, MAX_BOARD * MAX_BOARD, stones);
   else if (semeai_call)
     find_superstring_conservative(pos, &num_stones, stones);
   else
@@ -6678,10 +6678,17 @@
   int pos;
   int m, n;
   signed char safe_stones[BOARDMAX];
+  SGFTree *save_sgf_dumptree = sgf_dumptree;
+  int save_count_variations = count_variations;
   signed char mx[BOARDMAX];
   memset(mx, 0, sizeof(mx));
-  
+    
+  sgf_dumptree = NULL;
+  count_variations = 0;
   get_lively_stones(OTHER_COLOR(owl->color), safe_stones);
+  sgf_dumptree = save_sgf_dumptree;
+  count_variations = save_count_variations;
+
   compute_escape_influence(owl->color, safe_stones, NULL, NULL,
 			   owl->escape_values);
 
Index: engine/reading.c
===================================================================
--- engine/reading.c	(revision 2407)
+++ engine/reading.c	(working copy)
@@ -1636,7 +1636,7 @@
 static int 
 defend3(int str, int *move)
 {
-  int color, other;
+  int color;
   int xpos = NO_MOVE;
   int liberties;
   int libs[3];
@@ -1650,7 +1650,6 @@
   reading_node_counter++;
 
   color = board[str];
-  other = OTHER_COLOR(color);
 
   ASSERT1(IS_STONE(board[str]), str);
   ASSERT1(countlib(str) == 3, str);
@@ -1690,6 +1689,7 @@
 #if 0
   /* Look for backfilling moves. */
   if (stackp <= backfill_depth) {
+    int other = OTHER_COLOR(color);
     int liberties2;
     int libs2[6];
     int r;
Index: engine/dragon.c
===================================================================
--- engine/dragon.c	(revision 2407)
+++ engine/dragon.c	(working copy)
@@ -68,7 +68,7 @@
 				     int eye_color, struct eye_data *eye,
 				     signed char *mx, signed char *me,
 				     int *halfeyes);
-static int compute_crude_status(int pos);
+static enum dragon_status compute_crude_status(int pos);
 static int compute_escape(int pos, int dragon_status_known);
 static void compute_surrounding_moyo_sizes(const struct influence_data *q);
 static void clear_cut_list(void);
@@ -1739,7 +1739,7 @@
  * the genus is <2, it has no escape route, and no adjoining string can
  * be easily captured. Otherwise it is judged UNKNOWN.  */
 
-static int 
+static enum dragon_status
 compute_crude_status(int pos)
 {
   /* FIXME: We lose information when constructing true_genus. This
@@ -2363,14 +2363,14 @@
  * the dragon structure to the external program.
  */
 
-int
+enum dragon_status
 crude_status(int pos)
 {
   return dragon[pos].crude_status;
 }
 
 
-int
+enum dragon_status
 dragon_status(int pos)
 {
   return dragon[pos].status;
Index: engine/liberty.h
===================================================================
--- engine/liberty.h	(revision 2407)
+++ engine/liberty.h	(working copy)
@@ -291,6 +291,7 @@
 int dragon_weak(int pos);
 float dragon_weakness(int pos, int ignore_dead_dragons);
 int size_of_biggest_critical_dragon(void);
+void change_dragon_status(int dr, enum dragon_status status);
 float blunder_size(int move, int color, int *defense_point,
 		   signed char safe_stones[BOARDMAX]);
 void set_depth_values(int level, int report_levels);
@@ -898,10 +899,10 @@
   int moyo_size;		      /* size of surrounding influence moyo, */
   float moyo_territorial_value;       /* ...and its territorial value        */
   enum dragon_status safety;          /* a more detailed status estimate     */
-  float weakness; /* A new (3.4) continuous estimate of the dragon's safety  */
-  float weakness_pre_owl;     /* Dragon safety based on pre-owl computations */
+  float weakness;           /* a continuous estimate of the dragon's safety  */
+  float weakness_pre_owl;   /* dragon safety based on pre-owl computations   */
   float strategic_size; /* An effective size including weakness of neighbors */
-  int escape_route; /* a measurement of likelihood of escape                 */
+  int escape_route;         /* a measurement of likelihood of escape         */
   struct eyevalue genus;    /* the number of eyes (approximately)            */
   int heye;     /* coordinates of a half eye                                 */
   int lunch;    /* if lunch != 0 then lunch points to a boundary worm which  */
Index: engine/gnugo.h
===================================================================
--- engine/gnugo.h	(revision 2407)
+++ engine/gnugo.h	(working copy)
@@ -127,8 +127,8 @@
 extern int printboard;		/* print board each move */
 extern int showstatistics;	/* print statistics */
 extern int profile_patterns;	/* print statistics of pattern usage */
-extern char outfilename[128];  /* output file (-o option) */
-extern int output_flags;       /* amount of output to outfile */
+extern char outfilename[128];	/* output file (-o option) */
+extern int output_flags;	/* amount of output to outfile */
 
 /* output flag bits */
 #define OUTPUT_MARKDRAGONS         0x0001  /* mark dead and critical dragons */
@@ -222,7 +222,7 @@
 extern int use_monte_carlo_genmove;  /* use Monte Carlo move generation */
 extern int mc_games_per_level;       /* number of Monte Carlo simulations per level */
 
-/* Mandatory values of reading parameters. Normally -1, if set at 
+/* Mandatory values of reading parameters. Normally -1, if set
  * these override the values derived from the level. */
 extern int mandated_depth;
 extern int mandated_backfill_depth;
@@ -267,9 +267,7 @@
 void end_draw_board(void);
 void showboard(int xo);  /* ascii rep. of board to stderr */
 
-double gg_gettimeofday(void);
 
-
 /* influence.c */
 void debug_influence_move(int move);
 
@@ -327,7 +325,6 @@
 /* ================================================================ */
 
 /* utils.c */
-void change_dragon_status(int dr, int status);
 void who_wins(int color, FILE *outfile);
 
 /* high-level routine to generate the best move for the given color */
@@ -346,8 +343,8 @@
 void make_dragons(int stop_before_owl);
 void initialize_dragon_data(void);
 void show_dragons(void);
-int crude_status(int pos);
-int dragon_status(int pos);
+enum dragon_status crude_status(int pos);
+enum dragon_status dragon_status(int pos);
 int same_dragon(int dr1, int dr2);
 
 /* debugging functions */
Index: engine/value_moves.c
===================================================================
--- engine/value_moves.c	(revision 2407)
+++ engine/value_moves.c	(working copy)
@@ -3080,7 +3080,8 @@
   }
 
   /* Introduction of strategical_weight and territorial_weight, 
-     for automatic fitting (3.5.1) */
+   * for automatic fitting. (3.5.1)
+   */
   tot_value = territorial_weight * move[pos].territorial_value + 
               strategical_weight * move[pos].strategical_value;
 
Index: engine/fuseki.c
===================================================================
--- engine/fuseki.c	(revision 2407)
+++ engine/fuseki.c	(working copy)
@@ -286,7 +286,6 @@
   struct fullboard_pattern *database;
   int q;
   int k;
-  int best_fuseki_value;
 
   /* Disable matching after a certain number of stones are placed on
    * the board.
@@ -315,7 +314,6 @@
 
   /* Choose randomly with respect to relative weights for matched moves.
    */
-  best_fuseki_value = fuseki_value[0];
   q = gg_rand() % fuseki_total_value;
   for (k = 0; k < num_fuseki_moves; k++) {
     q -= fuseki_value[k];
Index: engine/move_reasons.c
===================================================================
--- engine/move_reasons.c	(revision 2407)
+++ engine/move_reasons.c	(working copy)
@@ -469,7 +469,7 @@
 int
 attack_move_reason_known(int pos, int what)
 {
-  ASSERT1(IS_STONE(board[what]), what);
+  ASSERT1(what < 0 || IS_STONE(board[what]), what);
   what = worm[what].origin;
   if (move_reason_known(pos, ATTACK_MOVE, what))
     return WIN;
@@ -487,7 +487,7 @@
 int
 defense_move_reason_known(int pos, int what)
 {
-  ASSERT1(IS_STONE(board[what]), what);
+  ASSERT1(what < 0 || IS_STONE(board[what]), what);
   what = worm[what].origin;
   if (move_reason_known(pos, DEFEND_MOVE, what))
     return WIN;
Index: engine/matchpat.c
===================================================================
--- engine/matchpat.c	(revision 2407)
+++ engine/matchpat.c	(working copy)
@@ -62,8 +62,8 @@
       *total_hits += pattern->hits;
       *total_nodes += pattern->reading_nodes;
       *total_dfa_hits += pattern->dfa_hits;
-      fprintf(stderr, "%6d ", pattern->dfa_hits);
-      fprintf(stderr, "%6d %9d %8.1f %s\n", 
+      fprintf(stderr, "%6d %6d %9d %8.1f %s\n",
+	      pattern->dfa_hits,
 	      pattern->hits,
 	      pattern->reading_nodes,
 	      pattern->reading_nodes / (float) pattern->hits, 
Index: engine/montecarlo.c
===================================================================
--- engine/montecarlo.c	(revision 2407)
+++ engine/montecarlo.c	(working copy)
@@ -1117,7 +1117,7 @@
 }
 
 
-static int mc_play_random_move(struct mc_game *game, int move, int in_uct_tree)
+static int mc_play_random_move(struct mc_game *game, int move)
 {
   int result = mc_play_move(&game->mc, move, game->color_to_move);
 
@@ -1154,7 +1154,7 @@
   /* First finish the game, if it isn't already. */
   while (game->consecutive_passes < 3) {
     move = mc_generate_random_move(game, 0);
-    result = mc_play_random_move(game, move, 0);
+    result = mc_play_random_move(game, move);
     ASSERT1(result, move);
   }
 
@@ -1421,20 +1421,20 @@
 	    proper_small_eye = 0;
 	}
 	
-	if (!proper_small_eye && mc_play_random_move(&tree->game, *move, 1))
+	if (!proper_small_eye && mc_play_random_move(&tree->game, *move))
 	  return uct_find_node(tree, node, *move);
       }
     }
   }
   
   if (!next_arc) {
-    mc_play_random_move(&tree->game, PASS_MOVE, 1);
+    mc_play_random_move(&tree->game, PASS_MOVE);
     *move = PASS_MOVE;
     return uct_find_node(tree, node, PASS_MOVE);
   }
 
   *move = next_arc->move;
-  mc_play_random_move(&tree->game, next_arc->move, 1);
+  mc_play_random_move(&tree->game, next_arc->move);
   
   return next_arc->node;
 }
Index: engine/sgfdecide.c
===================================================================
--- engine/sgfdecide.c	(revision 2407)
+++ engine/sgfdecide.c	(working copy)
@@ -389,6 +389,10 @@
   if (*outfilename)
     sgffile_begindump(&tree);
 
+  /* FIXME: Calling status_to_string() with a result code as argument
+   * doesn't make sense. It could be changed to result_to_string() but
+   * the overall formatting needs change as well.
+   */
   owl_analyze_semeai(apos, bpos, &resulta, &resultb, &move, 0, &dummy);
   gprintf("After %s at %1m, %1m is %s, %1m is %s (%d nodes)\n",
 	  color_to_string(color),
Index: engine/board.c
===================================================================
--- engine/board.c	(revision 2407)
+++ engine/board.c	(working copy)
@@ -1079,7 +1079,7 @@
 is_legal(int pos, int color)
 {
   /* 0. A pass move is always legal. */
-  if (pos == 0)
+  if (pos == PASS_MOVE)
     return 1;
 
   /* 1. The move must be inside the board. */
Index: engine/clock.c
===================================================================
--- engine/clock.c	(revision 2407)
+++ engine/clock.c	(working copy)
@@ -96,7 +96,7 @@
 void
 clock_print(int color)
 {
-  struct timer_data* const td
+  struct timer_data *const td
     = (color == BLACK) ? &black_time_data : &white_time_data;
 
   fprintf(stderr, "clock: "); 
@@ -181,7 +181,7 @@
 void
 update_time_left(int color, int time_left, int stones)
 {
-  struct timer_data* const td
+  struct timer_data *const td
     = ((color == BLACK) ? &black_time_data : &white_time_data);
   int time_used = td->official.time_left - time_left;
 
@@ -219,7 +219,7 @@
 {
   static double last_time = -1.0;
   static int last_movenum = -1;
-  struct timer_data* const td
+  struct timer_data *const td
     = (color == BLACK) ? &black_time_data : &white_time_data;
   double now = gg_gettimeofday();
 
@@ -282,7 +282,7 @@
 analyze_time_data(int color, double *time_for_last_move, double *time_left,
 		  int *stones_left)
 {
-  struct remaining_time_data * const timer
+  struct remaining_time_data *const timer
     = (color == BLACK) ? &black_time_data.estimated
 	               : &white_time_data.estimated;
 

