diff --git a/i18n_string/i18n_string.inc b/i18n_string/i18n_string.inc
index 0b2d4fc..2008420 100644
--- a/i18n_string/i18n_string.inc
+++ b/i18n_string/i18n_string.inc
@@ -102,7 +102,11 @@ class i18n_string_object {
     $this->location = $this->textgroup . ':' . $this->context;
     $this->type = array_shift($parts);
     $this->objectid = $parts ? array_shift($parts) : '';
-    $this->objectkey = (int)$this->objectid;
+    $this->objectkey = 0;
+    if (is_numeric($string->objectid)) {
+      $this->objectkey = (int)$this->objectid;
+    }
+
     // Remaining elements glued again with ':'
     $this->property = $parts ? implode(':', $parts) : '';
 
@@ -703,9 +707,19 @@ class i18n_string_textgroup_default {
       // Create source string so we get an lid
       $this->save_source($string);
     }
+
+    // Convert objectid to objectkey if it's numeric.
     if (!isset($string->objectkey)) {
-      $string->objectkey = (int)$string->objectid;
+      if (is_numeric($string->objectid)) {
+        $string->objectkey = (int)$string->objectid;
+      }
     }
+
+    // Make sure objectkey is numeric.
+    if (!is_numeric($string->objectkey)) {
+      $string->objectkey = 0;
+    }
+
     if (!isset($string->format)) {
       $string->format = '';
     }
diff --git a/i18n_string/i18n_string.install b/i18n_string/i18n_string.install
index 30e8cd2..d3989ca 100644
--- a/i18n_string/i18n_string.install
+++ b/i18n_string/i18n_string.install
@@ -94,6 +94,8 @@ function i18n_string_schema() {
       ),
       'objectindex' => array(
         'type' => 'int',
+        'size' => 'big',
+        'length' => 20,
         'not null' => TRUE,
         'default' => 0,
         'description' => 'Integer value of Object ID.',
@@ -245,6 +247,16 @@ function i18n_string_update_7002() {
   }
 }
 
+/**
+ * Change objectindex from int to bigint.
+ */
+function i18n_string_update_7003() {
+  db_change_field('i18n_string', 'objectindex', 'objectindex', array(
+    'type' => 'int',
+    'size' => 'big',
+    'length' => 20,
+  ));
+}
 
 /**
  * Notes for update script
