Index: binary-improvements/MapRendering/Web/Web.cs
===================================================================
--- binary-improvements/MapRendering/Web/Web.cs	(revision 325)
+++ binary-improvements/MapRendering/Web/Web.cs	(revision 326)
@@ -107,5 +107,5 @@
 				);
 
-				connectionHandler = new ConnectionHandler (this);
+				connectionHandler = new ConnectionHandler ();
 
 				_listener.Prefixes.Add (string.Format ("http://*:{0}/", webPort + 2));
@@ -149,82 +149,84 @@
 
 		private void HandleRequest (IAsyncResult result) {
-			if (_listener.IsListening) {
-				Interlocked.Increment (ref handlingCount);
-				Interlocked.Increment (ref currentHandlers);
+			if (!_listener.IsListening) {
+				return;
+			}
+
+			Interlocked.Increment (ref handlingCount);
+			Interlocked.Increment (ref currentHandlers);
 
 //				MicroStopwatch msw = new MicroStopwatch ();
-				HttpListenerContext ctx = _listener.EndGetContext (result);
-				_listener.BeginGetContext (HandleRequest, _listener);
-				try {
-					HttpListenerRequest request = ctx.Request;
-					HttpListenerResponse response = ctx.Response;
-					response.SendChunked = false;
-
-					response.ProtocolVersion = new Version ("1.1");
-
-					WebConnection conn;
-					int permissionLevel = DoAuthentication (request, out conn);
-
-
-					//Log.Out ("Login status: conn!=null: {0}, permissionlevel: {1}", conn != null, permissionLevel);
-
-
-					if (conn != null) {
-						Cookie cookie = new Cookie ("sid", conn.SessionID, "/");
-						cookie.Expired = false;
-						cookie.Expires = new DateTime (2020, 1, 1);
-						cookie.HttpOnly = true;
-						cookie.Secure = false;
-						response.AppendCookie (cookie);
-					}
-
-					// No game yet -> fail request
-					if (GameManager.Instance.World == null) {
-						response.StatusCode = (int) HttpStatusCode.ServiceUnavailable;
-						return;
-					}
-
-					if (request.Url.AbsolutePath.Length < 2) {
-						handlers ["/index.htm"].HandleRequest (request, response, conn, permissionLevel);
-						return;
-					} else {
-						foreach (KeyValuePair<string, PathHandler> kvp in handlers) {
-							if (request.Url.AbsolutePath.StartsWith (kvp.Key)) {
-								if (!kvp.Value.IsAuthorizedForHandler (conn, permissionLevel)) {
-									response.StatusCode = (int) HttpStatusCode.Forbidden;
-									if (conn != null) {
-										//Log.Out ("Web.HandleRequest: user '{0}' not allowed to access '{1}'", conn.SteamID, kvp.Value.ModuleName);
-									}
-								} else {
-									kvp.Value.HandleRequest (request, response, conn, permissionLevel);
+			HttpListenerContext ctx = _listener.EndGetContext (result);
+			_listener.BeginGetContext (HandleRequest, _listener);
+			try {
+				HttpListenerRequest request = ctx.Request;
+				HttpListenerResponse response = ctx.Response;
+				response.SendChunked = false;
+
+				response.ProtocolVersion = new Version ("1.1");
+
+				WebConnection conn;
+				int permissionLevel = DoAuthentication (request, out conn);
+
+
+				//Log.Out ("Login status: conn!=null: {0}, permissionlevel: {1}", conn != null, permissionLevel);
+
+
+				if (conn != null) {
+					Cookie cookie = new Cookie ("sid", conn.SessionID, "/");
+					cookie.Expired = false;
+					cookie.Expires = new DateTime (2020, 1, 1);
+					cookie.HttpOnly = true;
+					cookie.Secure = false;
+					response.AppendCookie (cookie);
+				}
+
+				// No game yet -> fail request
+				if (GameManager.Instance.World == null) {
+					response.StatusCode = (int) HttpStatusCode.ServiceUnavailable;
+					return;
+				}
+
+				if (request.Url.AbsolutePath.Length < 2) {
+					handlers ["/index.htm"].HandleRequest (request, response, conn, permissionLevel);
+					return;
+				} else {
+					foreach (KeyValuePair<string, PathHandler> kvp in handlers) {
+						if (request.Url.AbsolutePath.StartsWith (kvp.Key)) {
+							if (!kvp.Value.IsAuthorizedForHandler (conn, permissionLevel)) {
+								response.StatusCode = (int) HttpStatusCode.Forbidden;
+								if (conn != null) {
+									//Log.Out ("Web.HandleRequest: user '{0}' not allowed to access '{1}'", conn.SteamID, kvp.Value.ModuleName);
 								}
-
-								return;
+							} else {
+								kvp.Value.HandleRequest (request, response, conn, permissionLevel);
 							}
+
+							return;
 						}
 					}
-
-					// Not really relevant for non-debugging purposes:
-					//Log.Out ("Error in Web.HandleRequest(): No handler found for path \"" + request.Url.AbsolutePath + "\"");
-					response.StatusCode = (int) HttpStatusCode.NotFound;
-				} catch (IOException e) {
-					if (e.InnerException is SocketException) {
-						Log.Out ("Error in Web.HandleRequest(): Remote host closed connection: " +
-						         e.InnerException.Message);
-					} else {
-						Log.Out ("Error (IO) in Web.HandleRequest(): " + e);
-					}
-				} catch (Exception e) {
-					Log.Out ("Error in Web.HandleRequest(): " + e);
-				} finally {
-					if (ctx != null && !ctx.Response.SendChunked) {
-						ctx.Response.Close ();
-					}
+				}
+
+				// Not really relevant for non-debugging purposes:
+				//Log.Out ("Error in Web.HandleRequest(): No handler found for path \"" + request.Url.AbsolutePath + "\"");
+				response.StatusCode = (int) HttpStatusCode.NotFound;
+			} catch (IOException e) {
+				if (e.InnerException is SocketException) {
+					Log.Out ("Error in Web.HandleRequest(): Remote host closed connection: " +
+					         e.InnerException.Message);
+				} else {
+					Log.Out ("Error (IO) in Web.HandleRequest(): " + e);
+				}
+			} catch (Exception e) {
+				Log.Out ("Error in Web.HandleRequest(): " + e);
+			} finally {
+				if (ctx != null && !ctx.Response.SendChunked) {
+					ctx.Response.Close ();
+				}
 
 //					msw.Stop ();
 //					totalHandlingTime += msw.ElapsedMicroseconds;
 //					Log.Out ("Web.HandleRequest(): Took {0} µs", msw.ElapsedMicroseconds);
-					Interlocked.Decrement (ref currentHandlers);
-				}
+				Interlocked.Decrement (ref currentHandlers);
 			}
 		}
