diff --git a/include/class.auth.php b/include/class.auth.php
index b5de88a11852e0f4e3636b1921de49dd05b77a99..09708971fe24750cb1c8db3fd69215554f345381 100644
--- a/include/class.auth.php
+++ b/include/class.auth.php
@@ -560,7 +560,7 @@ class StaffAuthStrikeBackend extends  AuthStrikeBackend {
         }
     }
 }
-StaffAuthenticationBackend::register(StaffAuthStrikeBackend);
+StaffAuthenticationBackend::register('StaffAuthStrikeBackend');
 
 /*
  * Backend to monitor user's failed login attempts
@@ -603,7 +603,7 @@ class UserAuthStrikeBackend extends  AuthStrikeBackend {
 
     }
 }
-UserAuthenticationBackend::register(UserAuthStrikeBackend);
+UserAuthenticationBackend::register('UserAuthStrikeBackend');
 
 
 class osTicketAuthentication extends StaffAuthenticationBackend {
@@ -626,7 +626,7 @@ class osTicketAuthentication extends StaffAuthenticationBackend {
     }
 
 }
-StaffAuthenticationBackend::register(osTicketAuthentication);
+StaffAuthenticationBackend::register('osTicketAuthentication');
 
 class PasswordResetTokenBackend extends StaffAuthenticationBackend {
     static $id = "pwreset.staff";
@@ -663,7 +663,7 @@ class PasswordResetTokenBackend extends StaffAuthenticationBackend {
         return parent::login($staff, $bk);
     }
 }
-StaffAuthenticationBackend::register(PasswordResetTokenBackend);
+StaffAuthenticationBackend::register('PasswordResetTokenBackend');
 
 /*
  * AuthToken Authentication Backend
@@ -749,7 +749,7 @@ class AuthTokenAuthentication extends UserAuthenticationBackend {
     }
 
 }
-UserAuthenticationBackend::register(AuthTokenAuthentication);
+UserAuthenticationBackend::register('AuthTokenAuthentication');
 
 //Simple ticket lookup backend used to recover ticket access link.
 // We're using authentication backend so we can guard aganist brute force
@@ -784,5 +784,5 @@ class AccessLinkAuthentication extends UserAuthenticationBackend {
     }
 
 }
-UserAuthenticationBackend::register(AccessLinkAuthentication);
+UserAuthenticationBackend::register('AccessLinkAuthentication');
 ?>
diff --git a/include/class.mailparse.php b/include/class.mailparse.php
index 7f90a748e4fdb459ef68c3d1a29ef8817531d63c..12d1b24281d6d2debbf950866d4f3d0a808043ed 100644
--- a/include/class.mailparse.php
+++ b/include/class.mailparse.php
@@ -188,14 +188,14 @@ class Mail_Parse {
     }
 
     function getCcAddressList(){
-        if (!($header = $this->struct->headers['cc']))
+        if (!($header = @$this->struct->headers['cc']))
             return null;
 
         return Mail_Parse::parseAddressList($header);
     }
 
     function getBccAddressList(){
-        if (!($header = $this->struct->headers['bcc']))
+        if (!($header = @$this->struct->headers['bcc']))
             return null;
 
         return Mail_Parse::parseAddressList($header);
@@ -212,7 +212,7 @@ class Mail_Parse {
     }
 
     function getReplyTo() {
-        if (!($header = $this->struct->headers['reply-to']))
+        if (!($header = @$this->struct->headers['reply-to']))
             return null;
 
         return Mail_Parse::parseAddressList($header);
@@ -255,7 +255,7 @@ class Mail_Parse {
     function getBody(){
         global $cfg;
 
-        if ($cfg->isHtmlThreadEnabled()) {
+        if ($cfg && $cfg->isHtmlThreadEnabled()) {
             if ($html=$this->getPart($this->struct,'text/html'))
                 $body = new HtmlThreadBody($html);
             elseif ($text=$this->getPart($this->struct,'text/plain'))
@@ -270,7 +270,7 @@ class Mail_Parse {
         else
             $body = new TextThreadBody('');
 
-        if ($cfg->stripQuotedReply())
+        if ($cfg && $cfg->stripQuotedReply())
             $body->stripQuotedReply($cfg->getReplySeparator());
 
         return $body;
@@ -278,9 +278,9 @@ class Mail_Parse {
 
     function getPart($struct, $ctypepart, $recurse=-1) {
 
-        if($struct && !$struct->parts) {
+        if($struct && !@$struct->parts) {
             $ctype = @strtolower($struct->ctype_primary.'/'.$struct->ctype_secondary);
-            if ($struct->disposition
+            if (@$struct->disposition
                     && (strcasecmp($struct->disposition, 'inline') !== 0))
                 return '';
             if ($ctype && strcasecmp($ctype,$ctypepart)==0) {
@@ -295,7 +295,7 @@ class Mail_Parse {
         }
 
         $data='';
-        if($struct && $struct->parts && $recurse) {
+        if($struct && @$struct->parts && $recurse) {
             foreach($struct->parts as $i=>$part) {
                 if($part && ($text=$this->getPart($part,$ctypepart,$recurse - 1)))
                     $data.=$text;
@@ -535,8 +535,8 @@ class EmailDataParser {
         else {
             // Typical email
             $data['message'] = $parser->getBody();
-            $data['in-reply-to'] = $parser->struct->headers['in-reply-to'];
-            $data['references'] = $parser->struct->headers['references'];
+            $data['in-reply-to'] = @$parser->struct->headers['in-reply-to'];
+            $data['references'] = @$parser->struct->headers['references'];
         }
 
         $data['subject'] = $parser->getSubject();