diff --git a/file_entity.pages.inc b/file_entity.pages.inc
index f885d4d..9d6e359 100644
--- a/file_entity.pages.inc
+++ b/file_entity.pages.inc
@@ -841,7 +841,7 @@ function file_entity_edit_submit($form, &$form_state) {
   }
 
   if (file_uri_scheme($file->uri) != $form_state['values']['scheme']) {
-    $file_destination = $form_state['storage']['scheme'] . '://' . file_uri_target($file->uri);
+    $file_destination = $form_state['values']['scheme'] . '://' . file_uri_target($file->uri);
     $file_destination = file_stream_wrapper_uri_normalize($file_destination);
     if ($moved_file = file_move($file, $file_destination, FILE_EXISTS_RENAME)) {
       // Only re-assign the file object if file_move() did not fail.
diff --git a/file_entity.test b/file_entity.test
index b3be1ce..20f47ca 100644
--- a/file_entity.test
+++ b/file_entity.test
@@ -979,6 +979,45 @@ class FileEntityAltTitleTestCase extends FileEntityTestHelper {
 }
 
 /**
+ * Test changing the scheme of a file.
+ */
+class FileEntityChangeSchemeTestCase extends FileEntityTestHelper {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Changing file scheme',
+      'description' => 'Test changing the scheme of a file.',
+      'group' => 'File entity',
+    );
+  }
+
+  function testChangeScheme() {
+    // Select the first text test file to use.
+    $file = $this->createFileEntity(array('type' => 'document'));
+    $this->assertEqual(file_uri_scheme($file->uri), 'public', 'File is public.');
+
+    // Create a user with file edit permissions.
+    $user = $this->drupalCreateUser(array('edit any document files'));
+    $this->drupalLogin($user);
+
+    $this->drupalGet('file/' . $file->fid . '/edit');
+    $this->assertNoFieldByName('scheme');
+
+    // Create a user with file admin permissions.
+    $user = $this->drupalCreateUser(array('edit any document files', 'administer files'));
+    $this->drupalLogin($user);
+
+    $this->drupalGet('file/' . $file->fid . '/edit');
+    $this->assertFieldByName('scheme', 'public');
+
+    $this->drupalPost(NULL, array('scheme' => 'private'), 'Save');
+    $file = entity_load_unchanged('file', $file->fid);
+    $this->assertEqual(file_uri_scheme($file->uri), 'private', 'File has changed to private.');
+  }
+
+}
+
+/**
  * Tests replacing the file associated with a file entity.
  */
 class FileEntityReplaceTestCase extends FileEntityTestHelper {
