diff --git modules/node/node.module modules/node/node.module
index bafb54f..a1a669a 100644
--- modules/node/node.module
+++ modules/node/node.module
@@ -1002,17 +1002,16 @@ function node_validate($node, $form, &$form_state) {
  * Prepare node for saving by populating author and creation date.
  */
 function node_submit($node) {
-  global $user;
 
   // A user might assign the node author by entering a user name in the node
   // form, which we then need to translate to a user ID.
   if (isset($node->name)) {
-    if ($account = user_load_by_name($node->name)) {
-      $node->uid = $account->uid;
-    }
-    else {
-      $node->uid = 0;
-    }
+    $node->uid = ($account = user_load_by_name($node->name)) ? $account->uid : 0;
+  }
+  // If a user name is not provided nor a $node->uid, the node is assigned by 
+  // defaut to Anonymous (uid=0)
+  elseif (!isset($node->uid)) {
+    $node->uid = 0;
   }
 
   $node->created = !empty($node->date) ? strtotime($node->date) : REQUEST_TIME;
