Trying to fix bug in scan_cron.php (call to method on non-object error).