Index: binary-improvements/7dtd-server-fixes/src/JSON/JSONNumber.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/JSON/JSONNumber.cs	(revision 324)
+++ binary-improvements/7dtd-server-fixes/src/JSON/JSONNumber.cs	(revision 325)
@@ -2,32 +2,25 @@
 using System.Text;
 
-namespace AllocsFixes.JSON
-{
-	public class JSONNumber : JSONValue
-	{
-		private double value;
+namespace AllocsFixes.JSON {
+	public class JSONNumber : JSONValue {
+		private readonly double value;
 
-		public JSONNumber (double value)
-		{
+		public JSONNumber (double value) {
 			this.value = value;
 		}
 
-		public double GetDouble ()
-		{
+		public double GetDouble () {
 			return value;
 		}
 
-		public int GetInt ()
-		{
-			return (int)Math.Round(value);
+		public int GetInt () {
+			return (int) Math.Round (value);
 		}
 
-		public override void ToString (StringBuilder stringBuilder, bool prettyPrint = false, int currentLevel = 0)
-		{
+		public override void ToString (StringBuilder stringBuilder, bool prettyPrint = false, int currentLevel = 0) {
 			stringBuilder.Append (value.ToCultureInvariantString ());
 		}
 
-		public static JSONNumber Parse (string json, ref int offset)
-		{
+		public static JSONNumber Parse (string json, ref int offset) {
 			//Log.Out ("ParseNumber enter (" + offset + ")");
 			StringBuilder sbNum = new StringBuilder ();
@@ -37,48 +30,56 @@
 			while (offset < json.Length) {
 				if (json [offset] >= '0' && json [offset] <= '9') {
-					if (hasExp)
+					if (hasExp) {
 						sbExp.Append (json [offset]);
-					else
+					} else {
 						sbNum.Append (json [offset]);
+					}
 				} else if (json [offset] == '.') {
 					if (hasExp) {
 						throw new MalformedJSONException ("Decimal separator in exponent");
+					}
+
+					if (hasDec) {
+						throw new MalformedJSONException ("Multiple decimal separators in number found");
+					}
+
+					if (sbNum.Length == 0) {
+						throw new MalformedJSONException ("No leading digits before decimal separator found");
+					}
+
+					sbNum.Append ('.');
+					hasDec = true;
+				} else if (json [offset] == '-') {
+					if (hasExp) {
+						if (sbExp.Length > 0) {
+							throw new MalformedJSONException ("Negative sign in exponent after digits");
+						}
+
+						sbExp.Append (json [offset]);
 					} else {
-						if (hasDec)
-							throw new MalformedJSONException ("Multiple decimal separators in number found");
-						else if (sbNum.Length == 0) {
-							throw new MalformedJSONException ("No leading digits before decimal separator found");
-						} else {
-							sbNum.Append ('.');
-							hasDec = true;
+						if (sbNum.Length > 0) {
+							throw new MalformedJSONException ("Negative sign in mantissa after digits");
 						}
-					}
-				} else	if (json [offset] == '-') {
-					if (hasExp) {
-						if (sbExp.Length > 0)
-							throw new MalformedJSONException ("Negative sign in exponent after digits");
-						else
-							sbExp.Append (json [offset]);
-					} else {
-						if (sbNum.Length > 0)
-							throw new MalformedJSONException ("Negative sign in mantissa after digits");
-						else
-							sbNum.Append (json [offset]);
+
+						sbNum.Append (json [offset]);
 					}
 				} else if (json [offset] == 'e' || json [offset] == 'E') {
-					if (hasExp)
+					if (hasExp) {
 						throw new MalformedJSONException ("Multiple exponential markers in number found");
-					else if (sbNum.Length == 0) {
+					}
+
+					if (sbNum.Length == 0) {
 						throw new MalformedJSONException ("No leading digits before exponential marker found");
-					} else {
-						sbExp = new StringBuilder ();
-						hasExp = true;
 					}
+
+					sbExp = new StringBuilder ();
+					hasExp = true;
 				} else if (json [offset] == '+') {
 					if (hasExp) {
-						if (sbExp.Length > 0)
+						if (sbExp.Length > 0) {
 							throw new MalformedJSONException ("Positive sign in exponent after digits");
-						else
-							sbExp.Append (json [offset]);
+						}
+
+						sbExp.Append (json [offset]);
 					} else {
 						throw new MalformedJSONException ("Positive sign in mantissa found");
@@ -86,6 +87,6 @@
 				} else {
 					double number;
-					if (!StringParsers.TryParseDouble(sbNum.ToString (), out number)) {
-						throw new MalformedJSONException ("Mantissa is not a valid decimal (\"" + sbNum.ToString () + "\")");
+					if (!StringParsers.TryParseDouble (sbNum.ToString (), out number)) {
+						throw new MalformedJSONException ("Mantissa is not a valid decimal (\"" + sbNum + "\")");
 					}
 
@@ -93,5 +94,5 @@
 						int exp;
 						if (!int.TryParse (sbExp.ToString (), out exp)) {
-							throw new MalformedJSONException ("Exponent is not a valid integer (\"" + sbExp.ToString () + "\")");
+							throw new MalformedJSONException ("Exponent is not a valid integer (\"" + sbExp + "\")");
 						}
 
@@ -102,10 +103,10 @@
 					return new JSONNumber (number);
 				}
+
 				offset++;
 			}
+
 			throw new MalformedJSONException ("End of JSON reached before parsing number finished");
 		}
-
 	}
 }
-
