diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 7c53a8850436f2f97f2a3105772328e5363c331d..27cdedc4e1e3796c4af6ab6a8561ba0d2bcb6e91 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -841,7 +841,7 @@ class ActionComm extends CommonObject
         if (! empty($elementtype))
         {
             if ($elementtype == 'project') $sql.= ' AND a.fk_project = '.$fk_element;
-            else $sql.= " AND a.fk_element = ".$fk_element." AND a.elementtype = '".$elementtype."'";
+            else $sql.= " AND a.fk_element = ".(int) $fk_element." AND a.elementtype = '".$elementtype."'";
         }
         if (! empty($filter)) $sql.= $filter;
 		if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index b685a2c8ec4cec8a1ba3976a35f4bbd34d32d647..cb77607261be4083c36ada574a7215dc71d726f4 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -536,7 +536,7 @@ class Expedition extends CommonObject
 			else
 			{
 				dol_syslog(get_class($this).'::Fetch no expedition found', LOG_ERR);
-				$this->error='Delivery with id '.$id.' not found sql='.$sql;
+				$this->error='Delivery with id '.$id.' not found';
 				return 0;
 			}
 		}