Fix variable references in cron utility function