diff --git a/data/CRMEntity.php b/data/CRMEntity.php
index 042b013114ecb31325e65bb9cd2cc2665ded7876..d57d536f320e39c48de80e55594e92e3a725a48f 100644
--- a/data/CRMEntity.php
+++ b/data/CRMEntity.php
@@ -985,7 +985,7 @@ class CRMEntity {
 
 		//Event triggering code
 		require_once("include/events/include.inc");
-		$em = null; // To avoid undefined variable warning.
+		$em = null;
 		//In Bulk mode stop triggering events
 		if(!self::isBulkSaveMode()) {
 			$em = new VTEventsManager($adb);
diff --git a/include/events/VTEntityData.inc b/include/events/VTEntityData.inc
index d62d4a048f27eb25355e462086e7164288bb07ee..3cc635d015c64227978c1a9e2988c012c106dfb7 100644
--- a/include/events/VTEntityData.inc
+++ b/include/events/VTEntityData.inc
@@ -85,7 +85,7 @@ class VTEntityData{
 
 		// added to compute label needed in event handlers
 		//TODO : need to make sure entity fields are cached
-		$entityFields = isset($crmEntity->moduleName) ? Vtiger_Functions::getEntityModuleInfo($crmEntity->moduleName) : '';
+		$entityFields = isset($crmEntity->moduleName) ? Vtiger_Functions::getEntityModuleInfo($crmEntity->moduleName) : array("fieldname" => array());
 		if (!empty($entityFields['fieldname'])) {
 			$entityFieldNames = explode(',', $entityFields['fieldname']);
 			$label = '';