diff --git a/contentanalysis.module b/contentanalysis.module
index bdb8a8d..56d768d 100644
--- a/contentanalysis.module
+++ b/contentanalysis.module
@@ -147,7 +147,7 @@ function contentanalysis_modal_popup() {
   }
   //ctools_ajax_render($output);
   print ajax_render($output);
-  exit;
+  drupal_exit();
 }
 
 /**
@@ -167,7 +167,7 @@ function contentanalysis_modal_popup_only() {
   }
   //ctools_ajax_render($output);
   print ajax_render($output);
-  exit;
+  drupal_exit();
 }
 
 /**
@@ -459,7 +459,7 @@ function contentanalysis_analyze_js() {
   $analysis = array();
   if ($_SESSION['contentanalysis']['code'] != $_POST['code']) {
     watchdog('contentanalysis', 'Blocked invalid attempt ' . $_SESSION['contentanalysis']['code'] . ' != ' . $_POST['code']);
-    exit;
+    drupal_exit();
   }
 
   $context = contentanalysis_get_default_context();
