diff --git a/elysia_cron.module b/elysia_cron.module
index 5393a3b..299508e 100644
--- a/elysia_cron.module
+++ b/elysia_cron.module
@@ -133,21 +133,34 @@ function elysia_cron_init() {
 }
 
 /**
+ * Implements hook_cron().
+ *
  * Hook cron is invoked only by standard drupal cron.
  * It's used to replace drupal cron.
+ *
+ * @param boolean $return
+ *   return to caller if TRUE, otherwise exit().
  */
-function elysia_cron_cron() {
-  // First cron run is executed in standard drupal way. This is to enable the use of install profiles
-  if (variable_get('cron_last', 0) == 0) {
+function elysia_cron_cron($return = FALSE) {
+  // First cron run is executed in standard drupal way. This is to enable the
+  // use of install profiles
+  if (variable_get('install_task') != 'done') {
+    return;
+  }
+
+  // If run from core cron through CLI then don't do anything (drush core-cron)
+  if (!$return && drupal_is_cli()) {
     return;
   }
+
   // If the path is 'admin/*' this is a manual cron run (probably by admin/logs/status)
   $manual_run = (arg(0) == 'admin');
-
   $result = elysia_cron_run($manual_run);
 
   if (EC_DRUPAL_VERSION < 7) {
-    // I must check for cron_semaphore and delete it if set (is not always deleted by elysia_cron_run, and this situation is only when called by drupal cron, so a check here is right)
+    // I must check for cron_semaphore and delete it if set (is not always
+    // deleted by elysia_cron_run, and this situation is only when called by
+    // drupal cron, so a check here is right)
     if (variable_get('cron_semaphore', false)) {
       global $conf;
       _ec_variable_del('cron_semaphore');
@@ -165,7 +178,12 @@ function elysia_cron_cron() {
     drupal_goto(_dcf_internal_path('admin/reports/status'));
   }
 
-  exit();
+  if ($return) {
+    return TRUE;
+  }
+  else {
+    drupal_exit();
+  }
 }
 
 /**
@@ -193,17 +211,17 @@ function elysia_cron_help($section, $arg = false) {
 // Variables managed by _ec_variable method, because are setted during cron execution handling (with standard variable_set this will invalidate variable cache in EVERY cron clock)
 $GLOBALS['_ec_variables_allowed'] = array(
   'elysia_cron_version', // Just for compatibility purpose during elysia_cron_update phase
-  'elysia_cron_semaphore', 
+  'elysia_cron_semaphore',
   'elysia_cron_last_run',
-  'elysia_cron_last_context', 
-  'cron_semaphore', 
+  'elysia_cron_last_context',
+  'cron_semaphore',
   'cron_last',
 );
 
 $GLOBALS['_ec_columns'] = array(
   'name', ' disable', ' rule', ' weight', ' context', ' running', ' last_run', ' last_aborted', ' abort_count', ' last_abort_function', ' last_execution_time', ' execution_count', ' avg_execution_time', ' max_execution_time', ' last_shutdown_time'
 );
- 
+
 function _ec_variable_init() {
   global $_ec_variables, $_ec_variables_allowed;
   $_ec_variables = array();
@@ -358,11 +376,11 @@ function elysia_cron_set($name, $channel = false, $values = array()) {
 
   if (EC_DRUPAL_VERSION >= 7) {
     db_merge('elysia_cron')->key(array('name' => $name))->fields($values)->execute();
-    
+
   } else {
     $fields = array("name" => "'%s'", "disable" => "%d", "rule" => "'%s'", "weight" => "%d", "context" => "'%s'", "running" => "%d", "last_run" => "%d", "last_aborted" => "%d", "abort_count" => "%d", "last_abort_function" => "'%s'", "last_execution_time" => "%d", "execution_count" => "%d", "avg_execution_time" => "%f", "max_execution_time" => "%d", "last_shutdown_time" => "%d");
     $ifields = array('disable', 'running', 'last_run', 'last_aborted', 'abort_count', 'last_execution_time', 'execution_count', 'avg_execution_time', 'max_execution_time', 'last_shutdown_time');
-    
+
     if (db_result(db_query('SELECT 1 FROM {elysia_cron} WHERE name = "%s"', $name))) {
       $uquery = array();
       $uvalues = array();
@@ -376,9 +394,9 @@ function elysia_cron_set($name, $channel = false, $values = array()) {
         }
       }
       $uvalues[] = $name;
-  
+
       db_query("update {elysia_cron} set " . implode(', ', $uquery) . " where name = '%s'", $uvalues);
-      
+
     } else {
       foreach ($ifields as $f) {
         if (empty($values[$f])) {
@@ -410,7 +428,7 @@ function elysia_cron_set($name, $channel = false, $values = array()) {
 function elysia_cron_get($name, $channel = false, $key, $default, $refresh = false) {
   global $elysia_cron_db_cache;
   static $elysia_cron_defaults;
-  
+
   if (!isset($elysia_cron_defaults)) {
     $elysia_cron_defaults = function_exists('elysia_cron_get_ctools_defaults') ? elysia_cron_get_ctools_defaults() : array();
   }
@@ -418,7 +436,7 @@ function elysia_cron_get($name, $channel = false, $key, $default, $refresh = fal
   if ($channel) {
     $name = ':' . $name;
   }
-  
+
   if ($refresh || !isset($elysia_cron_db_cache[$name])) {
     if (EC_DRUPAL_VERSION >= 7) {
       $elysia_cron_db_cache[$name] = db_query("select " . implode(", ", $GLOBALS['_ec_columns']) . " from {elysia_cron} where name = :name", array(':name' => $name))->fetchAssoc();
@@ -426,7 +444,7 @@ function elysia_cron_get($name, $channel = false, $key, $default, $refresh = fal
     else {
       $elysia_cron_db_cache[$name] = db_fetch_array(db_query("select " . implode(", ", $GLOBALS['_ec_columns']) . " from {elysia_cron} where name = '%s'", $name));
     }
-    
+
     if (!$elysia_cron_db_cache[$name] && isset($elysia_cron_defaults[$name])) {
       $elysia_cron_db_cache[$name] = (array)$elysia_cron_defaults[$name];
     }
@@ -697,9 +715,9 @@ function elysia_cron_reset_stats() {
 
 /*******************************************************************************
  * INTERNAL
- * 
+ *
  * WARN: Below this point the word "context" should be avoided (use channel)
- *   Disabled should always be referenced as "disabled" (in db is "disable" for 
+ *   Disabled should always be referenced as "disabled" (in db is "disable" for
  *   compatibility with Ctools )
  *******************************************************************************/
 
@@ -772,7 +790,7 @@ function elysia_cron_module_jobs() {
         );
       }
     }
-  
+
     foreach (module_implements('cronapi') as $module) {
       $fn = $module . '_cronapi';
       $l = $fn('list');
@@ -817,7 +835,7 @@ function elysia_cron_initialize($skipscript = false) {
     if (!$defrule) {
       $defrule = variable_get('elysia_cron_default_rule', '0 * * * *');
     }
-    
+
     $defweight = !empty($jobpars['weight']) ? $jobpars['weight'] : 0;
     if (!is_numeric($defweight)) {
       $defweight = 0;
