 modules/system/system.install |   10 +++++-----
 modules/user/user.install     |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git modules/system/system.install modules/system/system.install
index 0f6669f..7c3dd71 100644
--- modules/system/system.install
+++ modules/system/system.install
@@ -2043,12 +2043,12 @@ function system_update_7016() {
           $datatype = 'bigint';
           break;
       }
-      db_query('ALTER TABLE ' . $row->table . ' ALTER COLUMN ' . $row->field . ' TYPE ' . $datatype);
-      db_query('ALTER TABLE ' . $row->table . ' ADD CHECK (' . $row->field . ' >= 0)');
+      db_query('ALTER TABLE ' . $row->table . ' ALTER COLUMN "' . $row->field . '" TYPE ' . $datatype);
+      db_query('ALTER TABLE ' . $row->table . ' ADD CHECK ("' . $row->field . '" >= 0)');
     }
-    db_query('DROP DOMAIN smallint_unsigned');
-    db_query('DROP DOMAIN int_unsigned');
-    db_query('DROP DOMAIN bigint_unsigned');
+    db_query('DROP DOMAIN IF EXISTS smallint_unsigned');
+    db_query('DROP DOMAIN IF EXISTS int_unsigned');
+    db_query('DROP DOMAIN IF EXISTS bigint_unsigned');
   }
 }
 
diff --git modules/user/user.install modules/user/user.install
index b571f87..2811c6b 100644
--- modules/user/user.install
+++ modules/user/user.install
@@ -690,7 +690,7 @@ function user_update_7012(&$sandbox) {
     // Initialize batch update information.
     $sandbox['progress'] = 0;
     $sandbox['last_user_processed'] = -1;
-    $sandbox['max'] = db_query("SELECT COUNT(*) FROM {users} WHERE picture <> 0")->fetchField();
+    $sandbox['max'] = db_query("SELECT COUNT(*) FROM {users} WHERE picture <> ''")->fetchField();
   }
 
   // As a batch operation move the photos into the {file_managed} table and
