Index: /binary-improvements/MapRendering/Web/API/GetLog.cs
===================================================================
--- /binary-improvements/MapRendering/Web/API/GetLog.cs	(revision 349)
+++ /binary-improvements/MapRendering/Web/API/GetLog.cs	(revision 350)
@@ -5,15 +5,37 @@
 namespace AllocsFixes.NetConnections.Servers.Web.API {
 	public class GetLog : WebAPI {
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
-			int permissionLevel) {
-			int firstLine, lastLine;
+		private const int MAX_COUNT = 1000;
+		
+		public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user,
+			int _permissionLevel) {
+			int count, firstLine, lastLine;
 
-			if (req.QueryString ["firstLine"] == null || !int.TryParse (req.QueryString ["firstLine"], out firstLine)) {
-				firstLine = LogBuffer.Instance.OldestLine;
+			if (_req.QueryString ["count"] == null || !int.TryParse (_req.QueryString ["count"], out count)) {
+				count = 50;
+			}
+
+			if (count == 0) {
+				count = 1;
+			}
+
+			if (count > MAX_COUNT) {
+				count = MAX_COUNT;
+			}
+
+			if (count < -MAX_COUNT) {
+				count = -MAX_COUNT;
+			}
+
+			if (_req.QueryString ["firstLine"] == null || !int.TryParse (_req.QueryString ["firstLine"], out firstLine)) {
+				if (count > 0) {
+					firstLine = LogBuffer.Instance.OldestLine;
+				} else {
+					firstLine = LogBuffer.Instance.LatestLine;
+				}
 			}
 
 			JSONObject result = new JSONObject ();
 
-			List<LogBuffer.LogEntry> logEntries = LogBuffer.Instance.GetRange (ref firstLine, 50, out lastLine);
+			List<LogBuffer.LogEntry> logEntries = LogBuffer.Instance.GetRange (ref firstLine, count, out lastLine);
 
 			JSONArray entries = new JSONArray ();
@@ -25,5 +47,5 @@
 				entry.Add ("msg", new JSONString (logEntry.message));
 				entry.Add ("trace", new JSONString (logEntry.trace));
-				entry.Add ("type", new JSONString (logEntry.type.ToString ()));
+				entry.Add ("type", new JSONString (logEntry.type.ToStringCached ()));
 				entries.Add (entry);
 			}
@@ -33,5 +55,5 @@
 			result.Add ("entries", entries);
 
-			WriteJSON (resp, result);
+			WriteJSON (_resp, result);
 		}
 	}
Index: /binary-improvements/MapRendering/Web/LogBuffer.cs
===================================================================
--- /binary-improvements/MapRendering/Web/LogBuffer.cs	(revision 349)
+++ /binary-improvements/MapRendering/Web/LogBuffer.cs	(revision 350)
@@ -19,5 +19,5 @@
 			if (instance == null) {
 				instance = new LogBuffer ();
-			};
+			}
 		}
 
@@ -60,9 +60,9 @@
 		}
 
-		public LogEntry this [int index] {
+		public LogEntry this [int _index] {
 			get {
 				lock (logEntries) {
-					if (index >= listOffset && index < listOffset + logEntries.Count) {
-						return logEntries [index];
+					if (_index >= listOffset && _index < listOffset + logEntries.Count) {
+						return logEntries [_index];
 					}
 				}
@@ -101,27 +101,50 @@
 		}
 
+		private readonly List<LogEntry> emptyList = new List<LogEntry> ();
+
 		public List<LogEntry> GetRange (ref int _start, int _count, out int _end) {
 			lock (logEntries) {
-				if (_count < 1) {
+				int index;
+				
+				if (_count < 0) {
+					_count = -_count;
+					
+					if (_start >= listOffset + logEntries.Count) {
+						_start = listOffset + logEntries.Count - 1;
+					}
+
 					_end = _start;
-					return new List<LogEntry> ();
+
+					if (_start < listOffset) {
+						return emptyList;
+					}
+					
+					_start -= _count - 1;
+
+					if (_start < listOffset) {
+						_start = listOffset;
+					}
+
+					index = _start - listOffset;
+					_end += 1;
+					_count = _end - _start;
+				} else {
+					if (_start < listOffset) {
+						_start = listOffset;
+					}
+
+					if (_start >= listOffset + logEntries.Count) {
+						_end = _start;
+						return emptyList;
+					}
+
+					index = _start - listOffset;
+
+					if (index + _count > logEntries.Count) {
+						_count = logEntries.Count - index;
+					}
+
+					_end = _start + _count;
 				}
-
-				if (_start < listOffset) {
-					_start = listOffset;
-				}
-
-				if (_start >= listOffset + logEntries.Count) {
-					_end = _start;
-					return new List<LogEntry> ();
-				}
-
-				int index = _start - listOffset;
-
-				if (index + _count > logEntries.Count) {
-					_count = logEntries.Count - index;
-				}
-
-				_end = _start + _count;
 
 				return logEntries.GetRange (index, _count);
