Map.cs crash fix - credit to Regnak