diff --git a/include/class.ticket.php b/include/class.ticket.php
index c8a2ad008781a02e493985246a17d49f18ec18ff..e68f8d4f8c75c0b001d0f3f0cfd66953a69db5cd 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -1418,7 +1418,7 @@ class Ticket {
         if(!$alerts) return $msgid; //Our work is done...
 
         $autorespond = true;
-        if ($autorespond && $headers && TicketFilter::isAutoResponse(Mail_Parse::splitHeaders($headers)))
+        if ($autorespond && $vars['header'] && TicketFilter::isAutoResponse($vars['header']))
             $autorespond=false;
 
         $this->onMessage($autorespond); //must be called b4 sending alerts to staff.
@@ -1792,7 +1792,7 @@ class Ticket {
             }
 
             if($info['error']) {
-                $this->logNote('File Import Error', $error, 'SYSTEM', false);
+                $this->logNote('File Import Error', $info['error'], 'SYSTEM', false);
             } elseif (($id=$this->saveAttachment($info, $refid, $type))) {
                 $files[] = $id;
             }