diff --git a/qchess/qchess.py b/qchess/qchess.py
index 32e2c60df459f6f702996f1633c71fb7a720360e..3090373cf14accb6efe3bdab8c17a1643e5571a5 100755
--- a/qchess/qchess.py
+++ b/qchess/qchess.py
@@ -1229,13 +1229,11 @@ class HttpLog(LogFile):
 		LogFile.__init__(self, file_name)
 		self.file_name = file_name
 
-	def write(self, s):
+	def prelog(self):
 		self.log.close()
 		self.log = open(self.file_name, "w", 0)
 
 		LogFile.setup(self, game.board, game.players)
-
-		LogFile.write(self, s)
 		
 
 class HeadRequest(urllib2.Request):
@@ -1356,12 +1354,15 @@ class GameThread(StoppableThread):
 					if self.stopped():
 						break
 
+					if isinstance(log_file, HttpLog):
+						log_file.prelog()
+
 					self.board.update_move(x, y, x2, y2)
 					result = str(x) + " " + str(y) + " -> " + str(x2) + " " + str(y2)
 					for p2 in self.players:
 						p2.update(result) # Inform players of what happened
 
-					log(result)
+					log(result)					
 
 					if isinstance(graphics, GraphicsThread):
 						with graphics.lock:
@@ -1407,7 +1408,8 @@ class GameThread(StoppableThread):
 
 		log(self.final_result)
 
-		graphics.stop()
+		if isinstance(graphics, GraphicsThread):
+			graphics.stop()
 
 	
 # A thread that replays a log file
@@ -2330,4 +2332,4 @@ if __name__ == "__main__":
 		sys.exit(102)
 
 # --- main.py --- #
-# EOF - created from make on Wed Jan 30 17:20:26 WST 2013
+# EOF - created from make on Wed Jan 30 18:01:41 WST 2013
diff --git a/qchess/src/game.py b/qchess/src/game.py
index b3c7dd3ecdf86b50e6ab7647da807a828ad270b5..a62e280a6efc46a268d2926850ecc7f22270b133 100644
--- a/qchess/src/game.py
+++ b/qchess/src/game.py
@@ -71,12 +71,15 @@ class GameThread(StoppableThread):
 					if self.stopped():
 						break
 
+					if isinstance(log_file, HttpLog):
+						log_file.prelog()
+
 					self.board.update_move(x, y, x2, y2)
 					result = str(x) + " " + str(y) + " -> " + str(x2) + " " + str(y2)
 					for p2 in self.players:
 						p2.update(result) # Inform players of what happened
 
-					log(result)
+					log(result)					
 
 					if isinstance(graphics, GraphicsThread):
 						with graphics.lock:
@@ -122,7 +125,8 @@ class GameThread(StoppableThread):
 
 		log(self.final_result)
 
-		graphics.stop()
+		if isinstance(graphics, GraphicsThread):
+			graphics.stop()
 
 	
 # A thread that replays a log file
diff --git a/qchess/src/log.py b/qchess/src/log.py
index 981e936b5d9e27a9a4e37f1dffbb7ede50e56375..59e23e1158683b8bcf1a01fccc9856efd898dd28 100644
--- a/qchess/src/log.py
+++ b/qchess/src/log.py
@@ -28,13 +28,11 @@ class HttpLog(LogFile):
 		LogFile.__init__(self, file_name)
 		self.file_name = file_name
 
-	def write(self, s):
+	def prelog(self):
 		self.log.close()
 		self.log = open(self.file_name, "w", 0)
 
 		LogFile.setup(self, game.board, game.players)
-
-		LogFile.write(self, s)
 		
 
 class HeadRequest(urllib2.Request):