diff --git a/adodb-datadict.inc.php b/adodb-datadict.inc.php
index 5f2ffc9..e7629ca 100644
--- a/adodb-datadict.inc.php
+++ b/adodb-datadict.inc.php
@@ -180,6 +180,8 @@ class ADODB_DataDict {
 	var $autoIncrement = false;
 	var $dataProvider;
 	var $invalidResizeTypes4 = array('CLOB','BLOB','TEXT','DATE','TIME'); // for changetablesql
+	var $blobNotNull = false; // dbms supports NOT NULL for BLOB/TEXT columns
+	var $blobDefaults = false; // dbms supports defaults for BLOB/TEXT columns
 	var $blobSize = 100; 	/// any varchar/char field this size or greater is treated as a blob
 							/// in other words, we use a text area for editting.
 
@@ -719,12 +721,12 @@ class ADODB_DataDict {
 
 			$ftype = $this->_GetSize($ftype, $ty, $fsize, $fprec);
 
-			if ($ty == 'X' || $ty == 'X2' || $ty == 'B') $fnotnull = false; // some blob types do not accept nulls
+			if (($ty == 'X' || $ty == 'X2' || $ty == 'B') && $this->blobNotNull !== true) $fnotnull = false; // some blob types do not accept nulls
 
 			if ($fprimary) $pkey[] = $fname;
 
 			// some databases do not allow blobs to have defaults
-			if ($ty == 'X') $fdefault = false;
+			if ($ty == 'X' && $this->blobDefaults !== true) $fdefault = false;
 
 			// build list of indexes
 			if ($findex != '') {
diff --git a/adodb-xmlschema.inc.php b/adodb-xmlschema.inc.php
index 0890155..9634c1a 100644
--- a/adodb-xmlschema.inc.php
+++ b/adodb-xmlschema.inc.php
@@ -1456,6 +1456,8 @@ class adoSchema {
 		$this->success = 2;
 
 		$xmlParser = $this->create_parser();
+		// Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept
+		$previousValueOfEntityLoader = libxml_disable_entity_loader(true);
 
 		// Process the file
 		while( $data = fread( $fp, 4096 ) ) {
@@ -1468,6 +1470,7 @@ class adoSchema {
 			}
 		}
 
+		libxml_disable_entity_loader($previousValueOfEntityLoader);
 		xml_parser_free( $xmlParser );
 
 		return $this->sqlArray;
@@ -1502,6 +1505,8 @@ class adoSchema {
 		$this->success = 2;
 
 		$xmlParser = $this->create_parser();
+		// Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept
+		$previousValueOfEntityLoader = libxml_disable_entity_loader(true);
 
 		if( !xml_parse( $xmlParser, $xmlstring, TRUE ) ) {
 			die( sprintf(
@@ -1511,6 +1516,7 @@ class adoSchema {
 			) );
 		}
 
+		libxml_disable_entity_loader($previousValueOfEntityLoader);
 		xml_parser_free( $xmlParser );
 
 		return $this->sqlArray;
diff --git a/adodb-xmlschema03.inc.php b/adodb-xmlschema03.inc.php
index 45a59bb..19b369b 100644
--- a/adodb-xmlschema03.inc.php
+++ b/adodb-xmlschema03.inc.php
@@ -1612,6 +1612,8 @@ class adoSchema {
 		$this->success = 2;
 
 		$xmlParser = $this->create_parser();
+		// Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept
+		$previousValueOfEntityLoader = libxml_disable_entity_loader(true);
 
 		// Process the file
 		while( $data = fread( $fp, 4096 ) ) {
@@ -1624,6 +1626,7 @@ class adoSchema {
 			}
 		}
 
+		libxml_disable_entity_loader($previousValueOfEntityLoader);
 		xml_parser_free( $xmlParser );
 
 		return $this->sqlArray;
@@ -1659,6 +1662,8 @@ class adoSchema {
 		$this->success = 2;
 
 		$xmlParser = $this->create_parser();
+		// Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept
+		$previousValueOfEntityLoader = libxml_disable_entity_loader(true);
 
 		if( !xml_parse( $xmlParser, $xmlstring, TRUE ) ) {
 			die( sprintf(
@@ -1668,6 +1673,7 @@ class adoSchema {
 			) );
 		}
 
+		libxml_disable_entity_loader($previousValueOfEntityLoader);
 		xml_parser_free( $xmlParser );
 
 		return $this->sqlArray;
diff --git a/datadict/datadict-mysql.inc.php b/datadict/datadict-mysql.inc.php
index c1433ae..be15bb4 100644
--- a/datadict/datadict-mysql.inc.php
+++ b/datadict/datadict-mysql.inc.php
@@ -23,6 +23,7 @@ class ADODB2_mysql extends ADODB_DataDict {
 
 	var $dropIndex = 'DROP INDEX %s ON %s';
 	var $renameColumn = 'ALTER TABLE %s CHANGE COLUMN %s %s %s';	// needs column-definition!
+	var $blobNotNull = true;
 
 	function MetaType($t,$len=-1,$fieldobj=false)
 	{
diff --git a/datadict/datadict-oci8.inc.php b/datadict/datadict-oci8.inc.php
index 6cedf95..7587a4b 100644
--- a/datadict/datadict-oci8.inc.php
+++ b/datadict/datadict-oci8.inc.php
@@ -197,15 +197,19 @@ end;
 	{
 		if (!$this->seqField) return array();
 
+		$sequenceTriggerTableName = trim($tabname, $this->connection->nameQuote);
 		if ($this->schema) {
-			$t = strpos($tabname,'.');
-			if ($t !== false) $tab = substr($tabname,$t+1);
-			else $tab = $tabname;
-			$seqname = $this->schema.'.'.$this->seqPrefix.$tab;
-			$trigname = $this->schema.'.'.$this->trigPrefix.$this->seqPrefix.$tab;
+			$t = strpos($tabname, '.');
+			if ($t !== FALSE) {
+					$tab = substr($sequenceTriggerTableName, $t + 1);
+			} else {
+					$tab = $sequenceTriggerTableName;
+			}
+			$seqname = $this->schema . '.' . $this->seqPrefix . $tab;
+			$trigname = $this->schema . '.' . $this->trigPrefix . $tab;
 		} else {
-			$seqname = $this->seqPrefix.$tabname;
-			$trigname = $this->trigPrefix.$seqname;
+			$seqname = $this->seqPrefix . $sequenceTriggerTableName;
+			$trigname = $this->trigPrefix . $sequenceTriggerTableName;
 		}
 
 		if (strlen($seqname) > 30) {
diff --git a/datadict/datadict-postgres.inc.php b/datadict/datadict-postgres.inc.php
index 98e6510..da7b65a 100644
--- a/datadict/datadict-postgres.inc.php
+++ b/datadict/datadict-postgres.inc.php
@@ -24,6 +24,8 @@ class ADODB2_postgres extends ADODB_DataDict {
 	var $quote = '"';
 	var $renameTable = 'ALTER TABLE %s RENAME TO %s'; // at least since 7.1
 	var $dropTable = 'DROP TABLE %s CASCADE';
+	var $blobNotNull = true;
+	var $blobDefaults = true;
 
 	function MetaType($t,$len=-1,$fieldobj=false)
 	{
diff --git a/drivers/adodb-mssqlnative.inc.php b/drivers/adodb-mssqlnative.inc.php
index 5d6b02b..dca512a 100644
--- a/drivers/adodb-mssqlnative.inc.php
+++ b/drivers/adodb-mssqlnative.inc.php
@@ -211,10 +211,10 @@ class ADODB_mssqlnative extends ADOConnection {
 		switch($this->mssql_version){
 		case 9:
 		case 10:
-			return $this->GenID2008();
+			return $this->GenID2008($seq, $start);
 			break;
 		case 11:
-			return $this->GenID2012();
+			return $this->GenID2012($seq, $start);
 			break;
 		}
 	}
@@ -227,10 +227,10 @@ class ADODB_mssqlnative extends ADOConnection {
 		switch($this->mssql_version){
 		case 9:
 		case 10:
-			return $this->CreateSequence2008();
+			return $this->CreateSequence2008($seq, $start);
 			break;
 		case 11:
-			return $this->CreateSequence2012();
+			return $this->CreateSequence2012($seq, $start);
 			break;
 		}
 
@@ -289,7 +289,7 @@ class ADODB_mssqlnative extends ADOConnection {
 		}
 		$num = $this->GetOne("select id from $seq");
 		sqlsrv_commit($this->_connectionID);
-		return true;
+		return $num;
 	}
 	/**
 	 * Only available to Server 2012 and up
@@ -313,7 +313,7 @@ class ADODB_mssqlnative extends ADOConnection {
 		}
 		if (!is_array($this->sequences)
 		|| is_array($this->sequences) && !in_array($seq,$this->sequences)){
-			$this->CreateSequence2012($seq='adodbseq',$start=1);
+			$this->CreateSequence2012($seq, $start);
 
 		}
 		$num = $this->GetOne("SELECT NEXT VALUE FOR $seq");
@@ -461,7 +461,7 @@ class ADODB_mssqlnative extends ADOConnection {
 				$this->_errorMsg .= "Message: ".$arrError[ 'message']."\n";
 			}
 		} else {
-			$this->_errorMsg = "No errors found";
+			$this->_errorMsg = '';
 		}
 		return $this->_errorMsg;
 	}
@@ -478,11 +478,26 @@ class ADODB_mssqlnative extends ADOConnection {
 	function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
 	{
 		if (!function_exists('sqlsrv_connect')) return null;
+		// Port is always given as part of $argHostname but
+		// 1) should only be set if using an IP/hostname and not a named instance
+		// 2) must use a comma instead of a colon
+		list ($hostname, $port) = explode(':', $argHostname, 2);
+		if (strpos($hostname, '\\') === false) {
+			   $argHostname = $hostname . ',' . $port;
+		} else {
+			$argHostname = $hostname;
+		}
 		$connectionInfo = $this->connectionInfo;
-		$connectionInfo["Database"]=$argDatabasename;
-		$connectionInfo["UID"]=$argUsername;
-		$connectionInfo["PWD"]=$argPassword;
-		
+		$connectionInfo['Database'] = $argDatabasename;
+		if (!empty($argUsername)) {
+			$connectionInfo['UID'] = $argUsername;
+		}
+		if (!empty($argPassword)) {
+			$connectionInfo['PWD'] = $argPassword;
+		}
+		if (!empty($this->charSet)) {
+			$connectionInfo['CharacterSet'] = $this->charSet;
+		}
 		foreach ($this->connectionParameters as $parameter=>$value)
 		    $connectionInfo[$parameter] = $value;
 		
