Improve ext/session error messages
diff --git a/system/libraries/Session/drivers/Session_database_driver.php b/system/libraries/Session/drivers/Session_database_driver.php
index 3ba9d3d..da03312 100644
--- a/system/libraries/Session/drivers/Session_database_driver.php
+++ b/system/libraries/Session/drivers/Session_database_driver.php
@@ -127,7 +127,7 @@
 	{
 		if (empty($this->_db->conn_id) && ! $this->_db->db_connect())
 		{
-			return $this->_failure;
+			return $this->_fail();
 		}
 
 		return $this->_success;
@@ -163,7 +163,7 @@
 				$this->_db->where('ip_address', $_SERVER['REMOTE_ADDR']);
 			}
 
-			if (($result = $this->_db->get()->row()) === NULL)
+			if ( ! ($result = $this->_db->get()) OR $result->row() === NULL)
 			{
 				// PHP7 will reuse the same SessionHandler object after
 				// ID regeneration, so we need to explicitly set this to
@@ -210,7 +210,7 @@
 		{
 			if ( ! $this->_release_lock() OR ! $this->_get_lock($session_id))
 			{
-				return $this->_failure;
+				return $this->_fail();
 			}
 
 			$this->_row_exists = FALSE;
@@ -218,7 +218,7 @@
 		}
 		elseif ($this->_lock === FALSE)
 		{
-			return $this->_failure;
+			return $this->_fail();
 		}
 
 		if ($this->_row_exists === FALSE)
@@ -237,7 +237,7 @@
 				return $this->_success;
 			}
 
-			return $this->_failure;
+			return $this->_fail();
 		}
 
 		$this->_db->where('id', $session_id);
@@ -260,7 +260,7 @@
 			return $this->_success;
 		}
 
-		return $this->_failure;
+		return $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------
@@ -275,7 +275,7 @@
 	public function close()
 	{
 		return ($this->_lock && ! $this->_release_lock())
-			? $this->_failure
+			? $this->_fail()
 			: $this->_success;
 	}
 
@@ -304,7 +304,7 @@
 
 			if ( ! $this->_db->delete($this->_config['save_path']))
 			{
-				return $this->_failure;
+				return $this->_fail();
 			}
 		}
 
@@ -314,7 +314,7 @@
 			return $this->_success;
 		}
 
-		return $this->_failure;
+		return $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------
@@ -334,7 +334,7 @@
 
 		return ($this->_db->delete($this->_config['save_path'], 'timestamp < '.(time() - $maxlifetime)))
 			? $this->_success
-			: $this->_failure;
+			: $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------
@@ -414,5 +414,4 @@
 
 		return parent::_release_lock();
 	}
-
 }
\ No newline at end of file