diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php
index a0c6895..3b2be23 100644
--- a/system/libraries/Ftp.php
+++ b/system/libraries/Ftp.php
@@ -32,7 +32,7 @@
 	var $port		= 21;
 	var $passive	= TRUE;
 	var $debug		= FALSE;
-	var $conn_id;
+	var $conn_id	= FALSE;
 
 
 	/**
@@ -80,19 +80,16 @@
 	 *
 	 * @access	public
 	 * @param	array	 the connection values
-	 * @param	bool	whether to use a secure or standard connection
 	 * @return	bool
 	 */	
-	function connect($config = array(), $secure = FALSE)
+	function connect($config = array())
 	{		
 		if (count($config) > 0)
 		{
 			$this->initialize($config);
 		}	
 	
-		$method = ($secure == FALSE) ? 'ftp_connect' : 'ftp_ssl_connect';
-	
-		if (FALSE === ($this->conn_id = @$method($this->hostname, $this->port)))
+		if (FALSE === ($this->conn_id = @ftp_connect($this->hostname, $this->port)))
 		{
 			if ($this->debug == TRUE)
 			{
@@ -122,20 +119,6 @@
 	// --------------------------------------------------------------------
 
 	/**
-	 * Secure FTP Connect
-	 *
-	 * @access	public
-	 * @param	array	 the connection values
-	 * @return	bool
-	 */		
-	function sconnect($config = array())
-	{
-		return $this->connect($config, TRUE);
-	}
-		
-	// --------------------------------------------------------------------
-
-	/**
 	 * FTP Login
 	 *
 	 * @access	private
@@ -149,6 +132,28 @@
 	// --------------------------------------------------------------------
 
 	/**
+	 * Validates the connection ID
+	 *
+	 * @access	private
+	 * @return	bool
+	 */	
+	function _is_conn()
+	{
+		if ( ! is_resource($this->conn_id))
+		{
+			if ($this->debug == TRUE)
+			{
+				$this->_error('ftp_no_connection');
+			}		
+			return FALSE;
+		}
+		return TRUE;
+	}
+
+	// --------------------------------------------------------------------
+
+
+	/**
 	 * Change direcotry
 	 *
 	 * The second parameter lets us momentarily turn off debugging so that
@@ -160,11 +165,11 @@
 	 * @access	public
 	 * @param	string
 	 * @param	bool
-	 * @return	array
+	 * @return	bool
 	 */	
 	function changedir($path = '', $supress_debug = FALSE)
 	{
-		if ($path == '')
+		if ($path == '' OR ! $this->_is_conn())
 		{
 			return FALSE;
 		}
@@ -190,11 +195,11 @@
 	 *
 	 * @access	public
 	 * @param	string
-	 * @return	array
+	 * @return	bool
 	 */	
-	function mkdir($path = '')
+	function mkdir($path = '', $permissions = NULL)
 	{
-		if ($path == '')
+		if ($path == '' OR ! $this->_is_conn())
 		{
 			return FALSE;
 		}
@@ -209,6 +214,12 @@
 			}		
 			return FALSE;		
 		}
+
+		// Set file permissions if needed
+		if ( ! is_null($permissions))
+		{
+			$this->chmod($path, (int)$permissions);
+		}
 		
 		return TRUE;
 	}
@@ -222,10 +233,15 @@
 	 * @param	string
 	 * @param	string
 	 * @param	string
-	 * @return	array
+	 * @return	bool
 	 */	
 	function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL)
 	{
+		if ( ! $this->_is_conn())
+		{
+			return FALSE;
+		}
+
 		if ( ! file_exists($locpath))
 		{
 			$this->_error('ftp_no_source_file');
@@ -265,15 +281,148 @@
 	// --------------------------------------------------------------------
 
 	/**
+	 * Rename (or move) a file
+	 *
+	 * @access	public
+	 * @param	string
+	 * @param	string
+	 * @param	bool
+	 * @return	bool
+	 */	
+	function rename($old_file, $new_file, $move = FALSE)
+	{
+		if ( ! $this->_is_conn())
+		{
+			return FALSE;
+		}
+
+		$result = @ftp_rename($this->conn_id, $old_file, $new_file);
+		
+		if ($result === FALSE)
+		{
+			if ($this->debug == TRUE)
+			{
+				$msg = ($move = FALSE) ? 'ftp_unable_to_remame' : 'ftp_unable_to_move';
+				
+				$this->_error($msg);
+			}		
+			return FALSE;		
+		}
+		
+		return TRUE;
+	}
+	
+	// --------------------------------------------------------------------
+
+	/**
+	 * Move a file
+	 *
+	 * @access	public
+	 * @param	string
+	 * @param	string
+	 * @return	bool
+	 */	
+	function move($old_file, $new_file)
+	{
+		return $this->rename($old_file, $new_file, TRUE);
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
+	 * Rename (or move) a file
+	 *
+	 * @access	public
+	 * @param	string
+	 * @return	bool
+	 */	
+	function delete_file($filepath)
+	{
+		if ( ! $this->_is_conn())
+		{
+			return FALSE;
+		}
+
+		$result = @ftp_delete($this->conn_id, $filepath);
+		
+		if ($result === FALSE)
+		{
+			if ($this->debug == TRUE)
+			{				
+				$this->_error('ftp_unable_to_delete');
+			}		
+			return FALSE;		
+		}
+		
+		return TRUE;
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
+	 * Delete a folder and recursively delete everything (including sub-folders)
+	 * containted within it.
+	 *
+	 * @access	public
+	 * @param	string
+	 * @return	bool
+	 */	
+	function delete_dir($filepath)
+	{
+		if ( ! $this->_is_conn())
+		{
+			return FALSE;
+		}
+
+		// Add a trailing slash to the file path if needed
+		$filepath = preg_replace("/(.+?)\/*$/", "\\1/",  $filepath);
+		
+		$list = $this->list_files($filepath);
+		
+		if ($list !== FALSE AND count($list) > 0)
+		{
+			foreach ($list as $item)
+			{			
+				// If we can't delete the item it's probaly a folder so
+				// we'll recursively call delete_dir()
+				if ( ! @ftp_delete($this->conn_id, $filepath.$item))
+				{
+					$this->delete_dir($filepath.$item);
+				}
+			}
+		}
+	
+		$result = @ftp_rmdir($this->conn_id, $filepath);
+		
+		if ($result === FALSE)
+		{
+			if ($this->debug == TRUE)
+			{				
+				$this->_error('ftp_unable_to_delete');
+			}		
+			return FALSE;		
+		}
+		
+		return TRUE;
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
 	 * Set file permissions
 	 *
 	 * @access	public
 	 * @param	string 	the file path
 	 * @param	string	the permissions
-	 * @return	array
+	 * @return	bool
 	 */		
 	function chmod($path, $perm)
 	{
+		if ( ! $this->_is_conn())
+		{
+			return FALSE;
+		}
+
 		// Permissions can only be set when running PHP 5
 		if ( ! function_exists('ftp_chmod'))
 		{
@@ -307,7 +456,12 @@
 	 * @return	array
 	 */	
 	function list_files($path = '.')
-	{		
+	{
+		if ( ! $this->_is_conn())
+		{
+			return FALSE;
+		}
+
 		return ftp_nlist($this->conn_id, $path);
 	}
 
@@ -326,7 +480,12 @@
 	 * @return	bool
 	 */	
 	function mirror($locpath, $rempath)
-	{	
+	{
+		if ( ! $this->_is_conn())
+		{
+			return FALSE;
+		}
+
 		// Open the local file path
 		if ($fp = @opendir($locpath))
 		{
@@ -427,6 +586,11 @@
 	 */	
 	function close()
 	{
+		if ( ! $this->_is_conn())
+		{
+			return FALSE;
+		}
+
 		@ftp_close($this->conn_id);
 	}