diff --git a/includes/postal.admin.inc b/includes/postal.admin.inc
index fd372e9..2104716 100644
--- a/includes/postal.admin.inc
+++ b/includes/postal.admin.inc
@@ -81,6 +81,11 @@ function postal_admin_import_states($country) {
   drupal_goto();
 }
 
+
+function _postal_admin_load_countries_cleanup($row) {
+ return (!isset($row[0]) || $row[0] == '#') ? FALSE : TRUE;
+}
+
 /**
  * Helper function to import the entire country list.
  * This is a quick and dirty function call to the country information provided 
@@ -91,26 +96,30 @@ function postal_admin_load_countries() {
   $existing = postal_country_load();
 
   $ret = drupal_http_request('http://download.geonames.org/export/dump/countryInfo.txt');
+  $keys = array('ISO', 'ISO3', 'ISO-Numeric', 'fips', 'Country', 'Capital', 'Area(insqkm)', 'Population', 'Continent', 'tld', 'CurrencyCode', 'CurrencyName', 'Phone', 'PostalCodeFormat', 'PostalCodeRegex', 'Languages', 'geonameid', 'neighbours', 'EquivalentFipsCode');
+
+  $rows = explode("\n", $ret->data);
+  $rows = array_filter($rows, '_postal_admin_load_countries_cleanup');
 
-  foreach (explode("\n", $ret->data) as $row) {
-    if ($row[0] == '#') continue;  // Skip comments.
+  foreach ($rows as $key => $value) {
+    $rows[$key] = array_combine($keys, explode("\t", $value));
 
-    $c = explode("\t", $row);
+    if ($rows[$key]['ISO'] && $rows[$key]['geonameid'] != 0) {
+      
     $item = array(
-      'id' => $c[16],
+      'id' => $rows[$key]['geonameid'],
       'parent_id' => NULL,
       'type' => 'country',
-      'code' => $c[0],
-      'name' => $c[4],
-      'iso' => $c[0],
-      'iso3' => $c[1],
-      'ison' => $c[2],
-      'fips' => $c[3],
-      'zip_format' => $c[13],
-      'zip_regex' => $c[14],
+      'code' => $rows[$key]['ISO'],
+      'name' => $rows[$key]['Country'],
+      'iso' => $rows[$key]['ISO'],
+      'iso3' => $rows[$key]['ISO3'],
+      'ison' => $rows[$key]['ISO-Numeric'],
+      'fips' => $rows[$key]['fips'],
+      'zip_format' => $rows[$key]['PostalCodeFormat'],
+      'zip_regex' => $rows[$key]['PostalCodeRegex'],
     );
 
-    if ($item['code']) {
       $update = ($existing && isset($existing[$item['code']])) ? 'id' : NULL;
       drupal_write_record('postal', $item, $update);
     }
diff --git a/postal.module b/postal.module
index 9c97c8a..0f98257 100644
--- a/postal.module
+++ b/postal.module
@@ -284,7 +284,7 @@ function postal_country_load($countries = NULL, $scope = NULL, $reset = FALSE) {
     }
   }
 
-  if ($single) return current($result);
+  if (isset($single)) return current($result);
   return $result;
 }
 
diff --git a/postal_field.module b/postal_field.module
index aa1ac12..6df3e4a 100644
--- a/postal_field.module
+++ b/postal_field.module
@@ -123,7 +123,7 @@ function postal_field_widget(&$form, &$form_state, $field, $items, $delta = 0) {
 
   // We know we're on the "default value" form because it's not fully-baked.
   // Unset any options that would stand in the way of setting useful defaults.
-  if (!$form['#id']) {
+  if (!isset($form['#id'])) {
     $settings = array();
   }
 
