Fix errors in cron module