diff --git a/include/class.canned.php b/include/class.canned.php
index 51d39ca48024410bdefecba03f20b7b030f30649..09a3877ada46bb507b649e65294bc6c0430399dd 100644
--- a/include/class.canned.php
+++ b/include/class.canned.php
@@ -144,6 +144,17 @@ class Canned {
         return $i;
     }
 
+    function deleteAttachment($file_id) {
+        $deleted = 0;
+        $sql='DELETE FROM '.CANNED_ATTACHMENT_TABLE
+            .' WHERE canned_id='.db_input($this->getId())
+            .'   AND file_id='.db_input($file_id);
+        if(db_query($sql) && db_affected_rows()) {
+            $deleted = AttachmentFile::deleteOrphans();
+        }
+        return ($deleted > 0);
+    }
+
     function deleteAttachments(){
 
         $deleted=0;
diff --git a/include/class.dept.php b/include/class.dept.php
index bf82b76526b7ce77abbdcdbaa213c939207ca4ad..9a1626baeabd7dbb337499e5a4ee15b6c9f7ecce 100644
--- a/include/class.dept.php
+++ b/include/class.dept.php
@@ -98,7 +98,7 @@ class Dept {
                 .'ORDER BY s.lastname, s.firstname';
             if(($res=db_query($sql)) && db_num_rows($res)){
                 while(list($id)=db_fetch_row($res))
-                    if($staff= Staff::lookup($id) && $staff->isAvailable())
+                    if(($staff=Staff::lookup($id)) && $staff->isAvailable())
                         $this->members[]= $staff;
             }
         }
diff --git a/include/class.faq.php b/include/class.faq.php
index b0fdc4ac2b0890895f0adfa3a3268f5e63531221..78b1a799e021f46ed4f44ba159f98568328eb4cd 100644
--- a/include/class.faq.php
+++ b/include/class.faq.php
@@ -218,6 +218,17 @@ class FAQ {
         return $i;
     }
 
+    function deleteAttachment($file_id) {
+        $deleted = 0;
+        $sql='DELETE FROM '.FAQ_ATTACHMENT_TABLE
+            .' WHERE faq_id='.db_input($this->getId())
+            .'   AND file_id='.db_input($file_id);
+        if(db_query($sql) && db_affected_rows()) {
+            $deleted = AttachmentFile::deleteOrphans();
+        }
+        return ($deleted > 0);
+    }
+
     function deleteAttachments(){
 
         $deleted=0;
diff --git a/include/class.ticket.php b/include/class.ticket.php
index 6a27d981bb24bdc7f05a6c8adec30615f0f7ed24..a40233c9e5a216f41da3eb91ba43d3bcd74bb0d9 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -540,7 +540,7 @@ class Ticket{
     }
 
     function getClientThread() {
-        return $this->getThreadwithoutNotes();
+        return $this->getThreadWithoutNotes();
     }
 
     function getThreadWithNotes() {
@@ -557,7 +557,7 @@ class Ticket{
         if($includeNotes) //Include notes??
             $treadtypes[] = 'N';
 
-        return $this->getThreadbyType($treadtypes, $order);
+        return $this->getThreadByType($treadtypes, $order);
     }
         
     function getThreadByType($type, $order='ASC') {