diff --git a/docroot/profiles/drupal_commons/modules/contrib/digests/digests.cron.inc b/docroot/profiles/drupal_commons/modules/contrib/digests/digests.cron.inc
index e7d1b73..2e6ac7d 100644
--- a/docroot/profiles/drupal_commons/modules/contrib/digests/digests.cron.inc
+++ b/docroot/profiles/drupal_commons/modules/contrib/digests/digests.cron.inc
@@ -20,14 +20,14 @@ function _digests_cron() {
   // Step 1: Get users for whom it is after 6PM in their timezone but who have not had a digest sent for this interval.
   $default = $now > $send_time + $default_tz || $now < $send_time + $default_tz - 43200; // whether it's past send_time in the site's default timezone
   $query = "
-    SELECT d.*, u.* /* We need the digests table first here, otherwise users with no digests row have uid = NULL in the results */
+    SELECT u.uid, u.mail, u.created, COALESCE(d.send_interval, $send_time) as send_interval, d.last_sent, u.timezone /* We need the digests table first here, otherwise users with no digests row have uid = NULL in the results */
     FROM {users} u
     LEFT JOIN {digests} d
       ON u.uid = d.uid
     WHERE
-      status = 1 AND (                                                  /* user is not blocked */
-        send_interval IS NULL OR                                        /* user has not set their interval */
-        send_interval = 86400                                           /* user's interval is daily */
+      u.status = 1 AND (                                                  /* user is not blocked */
+        d.send_interval IS NULL OR (                                      /* user has not set their interval */
+        d.send_interval = 86400                                           /* user's interval is daily */
         ". (date('w') == 0 ? 'OR send_interval = 604800' : '') ."       /* user's interval is weekly, and it's Sunday */
       ) AND
       %d > COALESCE(last_sent, created) + (COALESCE(send_interval, 86400) - 43200) /* it's been at least (interval - 12 hours) since the last digest email */
@@ -40,7 +40,7 @@ function _digests_cron() {
     if ($default) {
       $query .= "    OR timezone IS NULL /* the user has not set a timezone, fall back to the site default */";
     }
-    $query .= "\n      )";
+    $query .= "\n      ))";
     if (variable_get('digests_limit', 250)) {
       $result = db_query_range($query, $now, $now, $send_time, $now, $send_time, 0, variable_get('digests_limit', 250));
     }
