Index: binary-improvements/7dtd-server-fixes/src/PersistentData/Attributes.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/PersistentData/Attributes.cs	(revision 324)
+++ binary-improvements/7dtd-server-fixes/src/PersistentData/Attributes.cs	(revision 325)
@@ -1,22 +1,13 @@
 using System;
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-using System.Text.RegularExpressions;
 
-namespace AllocsFixes.PersistentData
-{
+namespace AllocsFixes.PersistentData {
 	[Serializable]
-	public class Attributes
-	{
+	public class Attributes {
 		private bool hideChatCommands;
 		private String hideChatCommandPrefix;
 
 		public bool HideChatCommands {
-			get {
-				return hideChatCommands;
-			}
-			set {
-				hideChatCommands = value;
-			}
+			get { return hideChatCommands; }
+			set { hideChatCommands = value; }
 		}
 
@@ -26,12 +17,9 @@
 					hideChatCommandPrefix = "";
 				}
+
 				return hideChatCommandPrefix;
 			}
-			set {
-				hideChatCommandPrefix = value;
-			}
+			set { hideChatCommandPrefix = value; }
 		}
-
 	}
 }
-
Index: binary-improvements/7dtd-server-fixes/src/PersistentData/InvItem.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/PersistentData/InvItem.cs	(revision 324)
+++ binary-improvements/7dtd-server-fixes/src/PersistentData/InvItem.cs	(revision 325)
@@ -2,6 +2,5 @@
 using System.Runtime.Serialization;
 
-namespace AllocsFixes.PersistentData
-{
+namespace AllocsFixes.PersistentData {
 	[Serializable]
 	public class InvItem {
@@ -26,3 +25,2 @@
 	}
 }
-
Index: binary-improvements/7dtd-server-fixes/src/PersistentData/Inventory.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/PersistentData/Inventory.cs	(revision 324)
+++ binary-improvements/7dtd-server-fixes/src/PersistentData/Inventory.cs	(revision 325)
@@ -3,85 +3,85 @@
 
 namespace AllocsFixes.PersistentData {
-    [Serializable]
-    public class Inventory {
-        public List<InvItem> bag;
-        public List<InvItem> belt;
-        public InvItem[] equipment;
+	[Serializable]
+	public class Inventory {
+		public List<InvItem> bag;
+		public List<InvItem> belt;
+		public InvItem[] equipment;
 
-        public Inventory () {
-            bag = new List<InvItem> ();
-            belt = new List<InvItem> ();
-            equipment = null;
-        }
+		public Inventory () {
+			bag = new List<InvItem> ();
+			belt = new List<InvItem> ();
+			equipment = null;
+		}
 
-        public void Update (PlayerDataFile pdf) {
-            lock (this) {
-                //Log.Out ("Updating player inventory - player id: " + pdf.id);
-                ProcessInv (bag, pdf.bag, pdf.id);
-                ProcessInv (belt, pdf.inventory, pdf.id);
-                ProcessEqu (pdf.equipment, pdf.id);
-            }
-        }
+		public void Update (PlayerDataFile pdf) {
+			lock (this) {
+				//Log.Out ("Updating player inventory - player id: " + pdf.id);
+				ProcessInv (bag, pdf.bag, pdf.id);
+				ProcessInv (belt, pdf.inventory, pdf.id);
+				ProcessEqu (pdf.equipment, pdf.id);
+			}
+		}
 
-        private void ProcessInv (List<InvItem> target, ItemStack[] sourceFields, int id) {
-            target.Clear ();
-            for (int i = 0; i < sourceFields.Length; i++) {
-                InvItem item = CreateInvItem (sourceFields [i].itemValue, sourceFields [i].count, id);
-                if (item != null && sourceFields [i].itemValue.Modifications != null) {
-                    ProcessParts (sourceFields [i].itemValue.Modifications, item, id);
-                }
+		private void ProcessInv (List<InvItem> target, ItemStack[] sourceFields, int id) {
+			target.Clear ();
+			for (int i = 0; i < sourceFields.Length; i++) {
+				InvItem item = CreateInvItem (sourceFields [i].itemValue, sourceFields [i].count, id);
+				if (item != null && sourceFields [i].itemValue.Modifications != null) {
+					ProcessParts (sourceFields [i].itemValue.Modifications, item, id);
+				}
 
-                target.Add (item);
-            }
-        }
+				target.Add (item);
+			}
+		}
 
-        private void ProcessEqu (Equipment sourceEquipment, int _playerId) {
-            equipment = new InvItem[sourceEquipment.GetSlotCount ()];
-            for (int i = 0; i < sourceEquipment.GetSlotCount (); i++) {
-                equipment [i] = CreateInvItem (sourceEquipment.GetSlotItem (i), 1, _playerId);
-            }
-        }
+		private void ProcessEqu (Equipment sourceEquipment, int _playerId) {
+			equipment = new InvItem[sourceEquipment.GetSlotCount ()];
+			for (int i = 0; i < sourceEquipment.GetSlotCount (); i++) {
+				equipment [i] = CreateInvItem (sourceEquipment.GetSlotItem (i), 1, _playerId);
+			}
+		}
 
-        private void ProcessParts (ItemValue[] _parts, InvItem _item, int _playerId) {
-            InvItem[] itemParts = new InvItem[_parts.Length];
-            for (int i = 0; i < _parts.Length; i++) {
-                InvItem partItem = CreateInvItem (_parts [i], 1, _playerId);
-                if (partItem != null && _parts [i].Modifications != null) {
-                    ProcessParts (_parts [i].Modifications, partItem, _playerId);
-                }
+		private void ProcessParts (ItemValue[] _parts, InvItem _item, int _playerId) {
+			InvItem[] itemParts = new InvItem[_parts.Length];
+			for (int i = 0; i < _parts.Length; i++) {
+				InvItem partItem = CreateInvItem (_parts [i], 1, _playerId);
+				if (partItem != null && _parts [i].Modifications != null) {
+					ProcessParts (_parts [i].Modifications, partItem, _playerId);
+				}
 
-                itemParts [i] = partItem;
-            }
+				itemParts [i] = partItem;
+			}
 
-            _item.parts = itemParts;
-        }
+			_item.parts = itemParts;
+		}
 
-        private InvItem CreateInvItem (ItemValue _itemValue, int _count, int _playerId) {
-            if (_count > 0 && _itemValue != null && !_itemValue.Equals (ItemValue.None)) {
-                ItemClass itemClass = ItemClass.list [_itemValue.type];
-                int maxAllowed = itemClass.Stacknumber.Value;
-                string name = itemClass.GetItemName ();
+		private InvItem CreateInvItem (ItemValue _itemValue, int _count, int _playerId) {
+			if (_count > 0 && _itemValue != null && !_itemValue.Equals (ItemValue.None)) {
+				ItemClass itemClass = ItemClass.list [_itemValue.type];
+				int maxAllowed = itemClass.Stacknumber.Value;
+				string name = itemClass.GetItemName ();
 
-                if (_count > maxAllowed) {
-                    Log.Out ("Player with ID " + _playerId + " has stack for \"" + name + "\" greater than allowed (" +
-                             _count + " > " + maxAllowed + ")");
-                }
+				if (_count > maxAllowed) {
+					Log.Out ("Player with ID " + _playerId + " has stack for \"" + name + "\" greater than allowed (" +
+					         _count + " > " + maxAllowed + ")");
+				}
 
-                InvItem item = null;
-                if (_itemValue.HasQuality) {
-                    item = new InvItem (name, _count, _itemValue.Quality, _itemValue.MaxUseTimes, _itemValue.UseTimes);
-                } else {
-                    item = new InvItem (name, _count, -1, _itemValue.MaxUseTimes, _itemValue.UseTimes);
-                }
+				InvItem item = null;
+				if (_itemValue.HasQuality) {
+					item = new InvItem (name, _count, _itemValue.Quality, _itemValue.MaxUseTimes, _itemValue.UseTimes);
+				} else {
+					item = new InvItem (name, _count, -1, _itemValue.MaxUseTimes, _itemValue.UseTimes);
+				}
 
-                item.icon = itemClass.GetIconName ();
+				item.icon = itemClass.GetIconName ();
 
-                item.iconcolor = AllocsUtils.ColorToHex (itemClass.GetIconTint ());
+				item.iconcolor = AllocsUtils.ColorToHex (itemClass.GetIconTint ());
 
-                return item;
-            } else {
-                return null;
-            }
-        }
-    }
+				return item;
+			}
+
+			return null;
+		}
+	}
 }
Index: binary-improvements/7dtd-server-fixes/src/PersistentData/PersistentContainer.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/PersistentData/PersistentContainer.cs	(revision 324)
+++ binary-improvements/7dtd-server-fixes/src/PersistentData/PersistentContainer.cs	(revision 325)
@@ -4,27 +4,26 @@
 using System.Runtime.Serialization.Formatters.Binary;
 
-namespace AllocsFixes.PersistentData
-{
+namespace AllocsFixes.PersistentData {
 	[Serializable]
-	public class PersistentContainer
-	{
+	public class PersistentContainer {
 		private Players players;
-		[OptionalField]
-		private Attributes attributes;
+		[OptionalField] private Attributes attributes;
 
 		public Players Players {
 			get {
-				if (players == null)
+				if (players == null) {
 					players = new Players ();
+				}
+
 				return players;
 			}
 		}
 
-		public Attributes Attributes
-		{
+		public Attributes Attributes {
 			get {
 				if (attributes == null) {
-					attributes = new Attributes();
+					attributes = new Attributes ();
 				}
+
 				return attributes;
 			}
@@ -38,14 +37,13 @@
 					instance = new PersistentContainer ();
 				}
+
 				return instance;
 			}
 		}
 
-		private PersistentContainer ()
-		{
+		private PersistentContainer () {
 		}
 
-		public void Save ()
-		{
+		public void Save () {
 			Stream stream = File.Open (GameUtils.GetSaveGameDir () + "/AllocsPeristentData.bin", FileMode.Create);
 			BinaryFormatter bFormatter = new BinaryFormatter ();
@@ -54,6 +52,5 @@
 		}
 
-		public static bool Load ()
-		{
+		public static bool Load () {
 			if (File.Exists (GameUtils.GetSaveGameDir () + "/AllocsPeristentData.bin")) {
 				try {
@@ -61,5 +58,5 @@
 					Stream stream = File.Open (GameUtils.GetSaveGameDir () + "/AllocsPeristentData.bin", FileMode.Open);
 					BinaryFormatter bFormatter = new BinaryFormatter ();
-					obj = (PersistentContainer)bFormatter.Deserialize (stream);
+					obj = (PersistentContainer) bFormatter.Deserialize (stream);
 					stream.Close ();
 					instance = obj;
@@ -70,8 +67,7 @@
 				}
 			}
+
 			return false;
 		}
-
 	}
 }
-
Index: binary-improvements/7dtd-server-fixes/src/PersistentData/Player.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/PersistentData/Player.cs	(revision 324)
+++ binary-improvements/7dtd-server-fixes/src/PersistentData/Player.cs	(revision 325)
@@ -4,36 +4,33 @@
 
 namespace AllocsFixes.PersistentData {
-    [Serializable]
-    public class Player {
-        private readonly string steamId;
-        private int entityId;
-        private string name;
-        private string ip;
-        private long totalPlayTime;
-
-        [OptionalField] private DateTime
-            lastOnline;
-
-        private Inventory inventory;
-
-        [OptionalField] private int
-            lastPositionX, lastPositionY, lastPositionZ;
-
-        [OptionalField] [Obsolete ("experience no longer available, use level and expToNextLevel instead")]
-        private uint experience;
-
-        [OptionalField] private bool chatMuted;
-        [OptionalField] private int maxChatLength;
-        [OptionalField] private string chatColor;
-        [OptionalField] private bool chatName;
-        [OptionalField] private uint expToNextLevel;
-        [OptionalField] private int level;
-
-        [NonSerialized] private ClientInfo
-            clientInfo;
-
-        public string SteamID {
-            get { return steamId; }
-        }
+	[Serializable]
+	public class Player {
+		private readonly string steamId;
+		private int entityId;
+		private string name;
+		private string ip;
+		private long totalPlayTime;
+
+		[OptionalField] private DateTime lastOnline;
+
+		private Inventory inventory;
+
+		[OptionalField] private int lastPositionX, lastPositionY, lastPositionZ;
+
+		[OptionalField] [Obsolete ("experience no longer available, use level and expToNextLevel instead")]
+		private uint experience;
+
+		[OptionalField] private bool chatMuted;
+		[OptionalField] private int maxChatLength;
+		[OptionalField] private string chatColor;
+		[OptionalField] private bool chatName;
+		[OptionalField] private uint expToNextLevel;
+		[OptionalField] private int level;
+
+		[NonSerialized] private ClientInfo clientInfo;
+
+		public string SteamID {
+			get { return steamId; }
+		}
 
         public int EntityID {
@@ -41,177 +38,181 @@
         }
 
-        public string Name {
-            get { return name == null ? string.Empty : name; }
-        }
-
-        public string IP {
-            get { return ip == null ? string.Empty : ip; }
-        }
-
-        public Inventory Inventory {
-            get {
-                if (inventory == null)
-                    inventory = new Inventory ();
-                return inventory;
-            }
-        }
-
-        public bool IsOnline {
-            get { return clientInfo != null; }
-        }
-
-        public ClientInfo ClientInfo {
-            get { return clientInfo; }
-        }
-
-        public EntityPlayer Entity {
-            get {
-                if (IsOnline) {
-                    return GameManager.Instance.World.Players.dict [clientInfo.entityId];
-                } else {
-                    return null;
-                }
-            }
-        }
-
-        public long TotalPlayTime {
-            get {
-                if (IsOnline) {
-                    return totalPlayTime + (long) (DateTime.Now - lastOnline).TotalSeconds;
-                } else {
-                    return totalPlayTime;
-                }
-            }
-        }
-
-        public DateTime LastOnline {
-            get {
-                if (IsOnline)
-                    return DateTime.Now;
-                else
-                    return lastOnline;
-            }
-        }
-
-        public Vector3i LastPosition {
-            get {
-                if (IsOnline)
-                    return new Vector3i (Entity.GetPosition ());
-                else
-                    return new Vector3i (lastPositionX, lastPositionY, lastPositionZ);
-            }
-        }
-
-        public bool LandProtectionActive {
-            get {
-                return GameManager.Instance.World.IsLandProtectionValidForPlayer (GameManager.Instance
-                    .GetPersistentPlayerList ().GetPlayerData (SteamID));
-            }
-        }
-
-        public float LandProtectionMultiplier {
-            get {
-                return GameManager.Instance.World.GetLandProtectionHardnessModifierForPlayer (GameManager.Instance
-                    .GetPersistentPlayerList ().GetPlayerData (SteamID));
-            }
-        }
-
-
-        [Obsolete ("Experience no longer available, use Level instead")]
-        public uint Experience {
-            get { return 0; }
-        }
-
-        public float Level {
-            get {
-                float expForNextLevel =
-                    (int) Math.Min ((Progression.BaseExpToLevel * Mathf.Pow (Progression.ExpMultiplier, level + 1)),
-                        int.MaxValue);
-                float fLevel = level + 1f - ((float) expToNextLevel / expForNextLevel);
-                return fLevel;
-            }
-        }
-
-        public bool IsChatMuted {
-            get { return chatMuted; }
-            set { chatMuted = value; }
-        }
-
-        public int MaxChatLength {
-            get {
-                if (maxChatLength == 0) {
-                    maxChatLength = 255;
-                }
-
-                return maxChatLength;
-            }
-            set { maxChatLength = value; }
-        }
-
-        public string ChatColor {
-            get {
-                if (chatColor == null || chatColor == "") {
-                    chatColor = "";
-                }
-
-                return chatColor;
-            }
-
-            set { chatColor = value; }
-        }
-
-        public bool ChatName {
-            get { return chatName; }
-
-            set { chatName = value; }
-        }
-
-        public void SetOffline () {
-            if (clientInfo != null) {
-                Log.Out ("Player set to offline: " + steamId);
-                lastOnline = DateTime.Now;
-                try {
-                    Vector3i lastPos = new Vector3i (Entity.GetPosition ());
-                    lastPositionX = lastPos.x;
-                    lastPositionY = lastPos.y;
-                    lastPositionZ = lastPos.z;
-                    totalPlayTime += (long) (Time.timeSinceLevelLoad - Entity.CreationTimeSinceLevelLoad);
-                } catch (NullReferenceException) {
-                    Log.Out ("Entity not available. Something seems to be wrong here...");
-                }
-
-                clientInfo = null;
-            }
-        }
-
-        public void SetOnline (ClientInfo ci) {
-            Log.Out ("Player set to online: " + steamId);
-            clientInfo = ci;
+		public string Name {
+			get { return name == null ? string.Empty : name; }
+		}
+
+		public string IP {
+			get { return ip == null ? string.Empty : ip; }
+		}
+
+		public Inventory Inventory {
+			get {
+				if (inventory == null) {
+					inventory = new Inventory ();
+				}
+
+				return inventory;
+			}
+		}
+
+		public bool IsOnline {
+			get { return clientInfo != null; }
+		}
+
+		public ClientInfo ClientInfo {
+			get { return clientInfo; }
+		}
+
+		public EntityPlayer Entity {
+			get {
+				if (IsOnline) {
+					return GameManager.Instance.World.Players.dict [clientInfo.entityId];
+				}
+
+				return null;
+			}
+		}
+
+		public long TotalPlayTime {
+			get {
+				if (IsOnline) {
+					return totalPlayTime + (long) (DateTime.Now - lastOnline).TotalSeconds;
+				}
+
+				return totalPlayTime;
+			}
+		}
+
+		public DateTime LastOnline {
+			get {
+				if (IsOnline) {
+					return DateTime.Now;
+				}
+
+				return lastOnline;
+			}
+		}
+
+		public Vector3i LastPosition {
+			get {
+				if (IsOnline) {
+					return new Vector3i (Entity.GetPosition ());
+				}
+
+				return new Vector3i (lastPositionX, lastPositionY, lastPositionZ);
+			}
+		}
+
+		public bool LandProtectionActive {
+			get {
+				return GameManager.Instance.World.IsLandProtectionValidForPlayer (GameManager.Instance
+					.GetPersistentPlayerList ().GetPlayerData (SteamID));
+			}
+		}
+
+		public float LandProtectionMultiplier {
+			get {
+				return GameManager.Instance.World.GetLandProtectionHardnessModifierForPlayer (GameManager.Instance
+					.GetPersistentPlayerList ().GetPlayerData (SteamID));
+			}
+		}
+
+
+		[Obsolete ("Experience no longer available, use Level instead")]
+		public uint Experience {
+			get { return 0; }
+		}
+
+		public float Level {
+			get {
+				float expForNextLevel =
+					(int) Math.Min (Progression.BaseExpToLevel * Mathf.Pow (Progression.ExpMultiplier, level + 1),
+						int.MaxValue);
+				float fLevel = level + 1f - expToNextLevel / expForNextLevel;
+				return fLevel;
+			}
+		}
+
+		public bool IsChatMuted {
+			get { return chatMuted; }
+			set { chatMuted = value; }
+		}
+
+		public int MaxChatLength {
+			get {
+				if (maxChatLength == 0) {
+					maxChatLength = 255;
+				}
+
+				return maxChatLength;
+			}
+			set { maxChatLength = value; }
+		}
+
+		public string ChatColor {
+			get {
+				if (chatColor == null || chatColor == "") {
+					chatColor = "";
+				}
+
+				return chatColor;
+			}
+
+			set { chatColor = value; }
+		}
+
+		public bool ChatName {
+			get { return chatName; }
+
+			set { chatName = value; }
+		}
+
+		public Player (string steamId) {
+			this.steamId = steamId;
+			inventory = new Inventory ();
+		}
+
+		public void SetOffline () {
+			if (clientInfo != null) {
+				Log.Out ("Player set to offline: " + steamId);
+				lastOnline = DateTime.Now;
+				try {
+					Vector3i lastPos = new Vector3i (Entity.GetPosition ());
+					lastPositionX = lastPos.x;
+					lastPositionY = lastPos.y;
+					lastPositionZ = lastPos.z;
+					totalPlayTime += (long) (Time.timeSinceLevelLoad - Entity.CreationTimeSinceLevelLoad);
+				} catch (NullReferenceException) {
+					Log.Out ("Entity not available. Something seems to be wrong here...");
+				}
+
+				clientInfo = null;
+			}
+		}
+
+		public void SetOnline (ClientInfo ci) {
+			Log.Out ("Player set to online: " + steamId);
+			clientInfo = ci;
             entityId = ci.entityId;
-            name = ci.playerName;
-            ip = ci.ip;
-            lastOnline = DateTime.Now;
-        }
-
-        public void Update (PlayerDataFile _pdf) {
-            UpdateProgression (_pdf);
-            inventory.Update (_pdf);
-        }
-
-        private void UpdateProgression (PlayerDataFile _pdf) {
-            if (_pdf.progressionData.Length > 0) {
-                using (PooledBinaryReader pbr = MemoryPools.poolBinaryReader.AllocSync (false)) {
-                    pbr.SetBaseStream (_pdf.progressionData);
-                    Progression p = Progression.Read (pbr, null);
-                    expToNextLevel = (uint) p.ExpToNextLevel;
-                    level = p.Level;
-                }
-            }
-        }
-
-        public Player (string steamId) {
-            this.steamId = steamId;
-            this.inventory = new Inventory ();
-        }
-    }
+			name = ci.playerName;
+			ip = ci.ip;
+			lastOnline = DateTime.Now;
+		}
+
+		public void Update (PlayerDataFile _pdf) {
+			UpdateProgression (_pdf);
+			inventory.Update (_pdf);
+		}
+
+		private void UpdateProgression (PlayerDataFile _pdf) {
+			if (_pdf.progressionData.Length > 0) {
+				using (PooledBinaryReader pbr = MemoryPools.poolBinaryReader.AllocSync (false)) {
+					pbr.SetBaseStream (_pdf.progressionData);
+					Progression p = Progression.Read (pbr, null);
+					expToNextLevel = (uint) p.ExpToNextLevel;
+					level = p.Level;
+				}
+			}
+		}
+	}
 }
Index: binary-improvements/7dtd-server-fixes/src/PersistentData/Players.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/PersistentData/Players.cs	(revision 324)
+++ binary-improvements/7dtd-server-fixes/src/PersistentData/Players.cs	(revision 325)
@@ -1,12 +1,10 @@
 using System;
 using System.Collections.Generic;
-using System.Runtime.Serialization;
 using System.Text.RegularExpressions;
 
-namespace AllocsFixes.PersistentData
-{
+namespace AllocsFixes.PersistentData {
 	[Serializable]
 	public class Players {
-		private Dictionary<string, Player> players = new Dictionary<string, Player> ();
+		private readonly Dictionary<string, Player> players = new Dictionary<string, Player> ();
 
 		public Player this [string steamId, bool create] {
@@ -14,15 +12,18 @@
 				if (string.IsNullOrEmpty (steamId)) {
 					return null;
-				} else if (players.ContainsKey (steamId)) {
+				}
+
+				if (players.ContainsKey (steamId)) {
 					return players [steamId];
-				} else {
-					if (create && steamId != null && steamId.Length == 17) {
-						Log.Out ("Created new player entry for ID: " + steamId);
-						Player p = new Player (steamId);
-						players.Add (steamId, p);
-						return p;
-					}
-					return null;
 				}
+
+				if (create && steamId != null && steamId.Length == 17) {
+					Log.Out ("Created new player entry for ID: " + steamId);
+					Player p = new Player (steamId);
+					players.Add (steamId, p);
+					return p;
+				}
+
+				return null;
 			}
 		}
@@ -53,28 +54,29 @@
 			if (_nameOrId.Length == 17 && long.TryParse (_nameOrId, out tempLong)) {
 				return _nameOrId;
-			} else {
-				int entityId = -1;
-				if (int.TryParse (_nameOrId, out entityId)) {
-					foreach (KeyValuePair<string, Player> kvp in players) {
-						if (kvp.Value.IsOnline && kvp.Value.EntityID == entityId) {
-							return kvp.Key;
-						}
-					}
-				}
+			}
 
-				_nameOrId = _nameOrId.ToLower ();
+			int entityId = -1;
+			if (int.TryParse (_nameOrId, out entityId)) {
 				foreach (KeyValuePair<string, Player> kvp in players) {
-					string name = kvp.Value.Name.ToLower ();
-					if (_ignoreColorCodes) {
-						name = Regex.Replace (name, "\\[[0-9a-fA-F]{6}\\]", "");
-					}
-					if (kvp.Value.IsOnline && name.Equals (_nameOrId)) {
+					if (kvp.Value.IsOnline && kvp.Value.EntityID == entityId) {
 						return kvp.Key;
 					}
 				}
 			}
+
+			_nameOrId = _nameOrId.ToLower ();
+			foreach (KeyValuePair<string, Player> kvp in players) {
+				string name = kvp.Value.Name.ToLower ();
+				if (_ignoreColorCodes) {
+					name = Regex.Replace (name, "\\[[0-9a-fA-F]{6}\\]", "");
+				}
+
+				if (kvp.Value.IsOnline && name.Equals (_nameOrId)) {
+					return kvp.Key;
+				}
+			}
+
 			return null;
 		}
 	}
 }
-
