diff --git a/includes/form.inc b/includes/form.inc
index 130775f..d74414c 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -2845,7 +2845,10 @@ function form_select_options($element, $choices = NULL) {
     }
     else {
       $key = (string) $key;
-      if ($value_valid && (!$value_is_array && (string) $element['#value'] === $key || ($value_is_array && in_array($key, $element['#value'])))) {
+      if ($value_is_array) {
+        $element['#value'] = array_map('strval', $element['#value']);
+      }
+      if ($value_valid && (!$value_is_array && (string) $element['#value'] === $key || ($value_is_array && in_array($key, $element['#value'], TRUE)))) {
         $selected = ' selected="selected"';
       }
       else {
diff --git a/modules/field/modules/list/tests/list.test b/modules/field/modules/list/tests/list.test
index b476b5a..d6496d3 100644
--- a/modules/field/modules/list/tests/list.test
+++ b/modules/field/modules/list/tests/list.test
@@ -372,6 +372,17 @@ function testListAllowedValuesText() {
     $this->assertAllowedValuesInput($string, $array, 'Values not in use can be removed.');
     $this->assertAllowedValuesInput("Zero", 'some values are being removed while currently in use', 'Values in use cannot be removed.');
 
+    // Check that string keys are properly marked selected.
+    $string = "Zero\nOne\nTwo\n7.50\n7.5";
+    $default = "7.50";
+    $edit = array('field[settings][allowed_values]' => $string);
+    $this->drupalPost($this->admin_path, $edit, t('Save settings'));
+    $edit = array($this->field_name . '[' . LANGUAGE_NONE . ']' => $default);
+    $this->drupalPost($this->admin_path, $edit, t('Save settings'));
+    $this->drupalGet($this->admin_path);
+    $this->assertOptionSelected('edit-field-list-text-und', $default);
+    $this->assertNoOptionSelected('edit-field-list-text-und', '7.5');
+
     // Delete the node, remove the value.
     node_delete($node->nid);
     $string = "Zero";
