diff --git a/diff.module b/diff.module
index a9c200a..aa0bc4b 100644
--- a/diff.module
+++ b/diff.module
@@ -152,19 +152,18 @@ function diff_node_view_alter(&$build) {
 }
 
 /**
- * Implements hook_form_alter().
+ * Implements hook_form_BASE_FORM_ID_alter().
  */
-function diff_form_alter(&$form, &$form_state, $form_id) {
-  if (!empty($form['#node_edit_form'])) {
-    // Add a 'View changes' button on the node edit form.
-    if (variable_get('show_preview_changes_' . $form['type']['#value'], TRUE) && $form['nid']['#value'] > 0) {
-      $form['actions']['preview_changes'] = array(
-        '#type' => 'submit',
-        '#value' => t('View changes'),
-        '#weight' => 12,
-        '#submit' => array('diff_node_form_build_preview_changes')
-      );
-    }
+function diff_form_node_form_alter(&$form, $form_state) {
+  // Add a 'View changes' button on the node edit form.
+  $node = $form['#node'];
+  if (variable_get('show_preview_changes_' . $node->type, TRUE) && !empty($node->nid)) {
+    $form['actions']['preview_changes'] = array(
+      '#type' => 'submit',
+      '#value' => t('View changes'),
+      '#weight' => 12,
+      '#submit' => array('diff_node_form_build_preview_changes')
+    );
   }
 }
 
