Index: wp-admin/includes/class-wp-filesystem-ssh2.php
===================================================================
--- wp-admin/includes/class-wp-filesystem-ssh2.php	(revision 8852)
+++ wp-admin/includes/class-wp-filesystem-ssh2.php	(working copy)
@@ -329,8 +329,9 @@
 	function touch($file, $time = 0, $atime = 0) {
 		//Not implmented.
 	}
-
+	
 	function mkdir($path, $chmod = null, $chown = false, $chgrp = false) {
+		$path = trim($path, '/');
 		if( ! ssh2_sftp_mkdir($this->sftp_link, $path, $chmod, true) )
 			return false;
 		if( $chown )
@@ -463,7 +464,6 @@
 		}
 		return $ret;
 	}
-
 	function __destruct(){
 		if ( $this->link )
 			unset($this->link);
Index: wp-admin/includes/file.php
===================================================================
--- wp-admin/includes/file.php	(revision 8852)
+++ wp-admin/includes/file.php	(working copy)
@@ -405,7 +405,7 @@
 		for ( $i = count($path) - 1; $i >= 0; $i-- ) { //>=0 as the first element contains data, count()-1, as we do not want the file component
 			$tmppath = $to . implode('/', array_slice($path, 0, $i) );
 			if ( $fs->is_dir($tmppath) ) {//Found the highest folder that exists, Create from here
-				for ( $i = $i + 1; $i < count($path); $i++ ) { //< count() no file component please.
+				for ( $i = $i + 1; $i <= count($path); $i++ ) { //< count() no file component please.
 					$tmppath = $to . implode('/', array_slice($path, 0, $i) );
 					if ( ! $fs->mkdir($tmppath, 0755) )
 						return new WP_Error('mkdir_failed', __('Could not create directory'), $tmppath);
@@ -487,6 +487,7 @@
 	}
 
 	if ( ! $method && isset($args['connection_type']) && 'ssh' == $args['connection_type'] && extension_loaded('ssh2') ) $method = 'ssh2';
+
 	if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext';
 	if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread
 	return apply_filters('filesystem_method', $method);
