diff --git a/webroot/sites/all/modules/workflow/workflow.module b/webroot/sites/all/modules/workflow/workflow.module
index 8a11f9d..430a0c4 100644
--- a/webroot/sites/all/modules/workflow/workflow.module
+++ b/webroot/sites/all/modules/workflow/workflow.module
@@ -196,7 +196,7 @@ function workflow_tokens($type, $tokens, array $data = array(), array $options =
             // The node is being submitted but the form data has not been saved to the database yet,
             // so we set the token values from the workflow form fields.
             $sid = $node->workflow;
-            $old_sid = isset($last_history->sid) ? $last_history->sid : workflow_get_creation_state_by_wid($workflow->wid);
+            $old_sid = isset($last_history->old_sid) ? $last_history->old_sid : workflow_get_creation_state_by_wid($workflow->wid);
             $sid = workflow_get_workflow_states_by_sid($sid);
             $old_sid = workflow_get_workflow_states_by_sid($old_sid);
             $date = REQUEST_TIME;
@@ -433,7 +433,7 @@ function workflow_features_api() {
 /**
  * Business related functions, the API.
  */
- 
+
 /**
  * Validate target state and either execute a transition immediately or schedule
  * a transition to be executed later by cron.
@@ -794,7 +794,7 @@ function workflow_node_current_state($node) {
   // There is no nid when creating a node.
   if (!empty($node->nid)) {
     $state = workflow_get_workflow_node_by_nid($node->nid);
-    if($state){  
+    if($state){
       $sid = $state->sid;
     }
   }
@@ -814,7 +814,7 @@ function workflow_node_previous_state($node) {
     $sids = array();
     $sid = -1;
     $last_history = workflow_get_workflow_node_history_by_nid($node->nid, 1);
-    $sid = $last_history->sid;
+    $sid = !$last_history ? false : $last_history->old_sid;
   }
   if (!$sid && !empty($node->type)) {
     // No current state. Use creation state.
@@ -874,7 +874,7 @@ function workflow_get_creation_state_by_wid($wid) {
 
 /**
  * Get all workflows.
- */ 
+ */
 function workflow_get_workflows() {
   $results = db_query('SELECT * FROM {workflows}');
   $workflows = $results->fetchAll();
@@ -967,7 +967,7 @@ function workflow_update_workflows(&$data, $create_creation_state = TRUE) {
 /**
  * Functions related to table workflow_type_map.
  */
- 
+
 /**
  * Get all workflow_type_map.
  */
@@ -1033,7 +1033,7 @@ function workflow_insert_workflow_type_map(&$data) {
 /**
  * Functions related to table workflow_transitions.
  */
- 
+
 /**
  * Given a tid, get the transition. It is a unique object, only one return.
  */
@@ -1133,7 +1133,7 @@ function workflow_update_workflow_transitions_roles($tid, $roles) {
 /**
  * Functions related to table workflow_states.
  */
- 
+
 /**
  * Get all states in the system, with options to filter, only where a workflow exists.
  */
