diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php
index 1bfab5cd645caaaec6930c27cdcc82bdb1fa9c8c..5274397c7630789ec06b292b2c6b878d38565b64 100644
--- a/apps/calendar/lib/calendar.php
+++ b/apps/calendar/lib/calendar.php
@@ -10,19 +10,6 @@
  * The following SQL statement is just a help for developers and will not be
  * executed!
  *
- * CREATE TABLE calendar_objects (
- *     id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
- *     calendarid INTEGER UNSIGNED NOT NULL,
- *     objecttype VARCHAR(40) NOT NULL,
- *     startdate DATETIME,
- *     enddate DATETIME,
- *     repeating INT(1),
- *     summary VARCHAR(255),
- *     calendardata TEXT,
- *     uri VARCHAR(100),
- *     lastmodified INT(11)
- * );
- *
  * CREATE TABLE calendar_calendars (
  *     id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
  *     userid VARCHAR(255),
@@ -35,6 +22,7 @@
  *     timezone TEXT,
  *     components VARCHAR(20)
  * );
+ *
  */
 
 /**
@@ -212,7 +200,20 @@ class OC_Calendar_Calendar{
 
 		return true;
 	}
-
+	
+	/*
+	 * @brief merges two calendars
+	 * @param integer $id1
+	 * @param integer $id2
+	 * @return boolean
+	 */
+	public static function mergeCalendar($id1, $id2){
+		$stmt = OCP\DB::prepare('UPDATE *PREFIX*calendar_objects SET calendarid = ? WHERE calendarid = ?');
+		$stmt->execute(array($id1, $id2));
+		self::touchCalendar($id1);
+		self::deleteCalendar($id2);
+	}
+	
 	/**
 	 * @brief Creates a URI for Calendar
 	 * @param string $name name of the calendar
@@ -238,6 +239,11 @@ class OC_Calendar_Calendar{
 		list($prefix,$userid) = Sabre_DAV_URLUtil::splitPath($principaluri);
 		return $userid;
 	}
+	
+	/*
+	 * @brief returns the possible color for calendars
+	 * @return array
+	 */
 	public static function getCalendarColorOptions(){
 		return array(
 			'#ff0000', // "Red"
@@ -251,6 +257,11 @@ class OC_Calendar_Calendar{
 		);
 	}
 
+	/*
+	 * @brief generates the Event Source Info for our JS
+	 * @param array $calendar calendar data
+	 * @return array
+	 */
 	public static function getEventSourceInfo($calendar){
 		return array(
 			'url' => OCP\Util::linkTo('calendar', 'ajax/events.php').'?calendar_id='.$calendar['id'],
diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php
index 0531a56fc5017dc417e546ac30fdd74ffa7d0025..5d475c8943465847d4dbdd9a50fb591d7099ae03 100644
--- a/apps/calendar/lib/object.php
+++ b/apps/calendar/lib/object.php
@@ -5,6 +5,25 @@
  * later.
  * See the COPYING-README file.
  */
+ /*
+ *
+ * The following SQL statement is just a help for developers and will not be
+ * executed!
+ *
+ * CREATE TABLE calendar_objects (
+ *     id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ *     calendarid INTEGER UNSIGNED NOT NULL,
+ *     objecttype VARCHAR(40) NOT NULL,
+ *     startdate DATETIME,
+ *     enddate DATETIME,
+ *     repeating INT(1),
+ *     summary VARCHAR(255),
+ *     calendardata TEXT,
+ *     uri VARCHAR(100),
+ *     lastmodified INT(11)
+ * );
+ *
+ */
 
 /**
  * This class manages our calendar objects
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 5b9e00a3783aa6d8b1eea943d12ba3c6d12c75db..95f8beeb49e0d78bbbcc7b87a3721148f1e7552c 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -45,7 +45,7 @@ class OC_Mount_Config {
 			'OC_Filestorage_FTP' => array('backend' => 'FTP', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'root' => '&Root', 'secure' => '!Secure ftps://')),
 			'OC_Filestorage_Google' => array('backend' => 'Google Drive', 'configuration' => array('token' => '#token', 'token_secret' => '#token secret'), 'custom' => 'google'),
 			'OC_Filestorage_SWIFT' => array('backend' => 'OpenStack Swift', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'token' => '*Token', 'root' => '&Root', 'secure' => '!Secure ftps://')),
-			'OC_Filestorage_SMB' => array('backend' => 'SMB', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'root' => '&Root')),
+			'OC_Filestorage_SMB' => array('backend' => 'SMB', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'share' => 'Share', 'root' => '&Root')),
 			'OC_Filestorage_DAV' => array('backend' => 'WebDAV', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'root' => '&Root', 'secure' => '!Secure https://'))
 		);
 	}
diff --git a/apps/files_external/lib/dropbox.php b/apps/files_external/lib/dropbox.php
index 6f1a154a1225e252049aa741dc75a01fd14486fc..e3fbb2449968e4d6362303343b19edafd1f852b4 100755
--- a/apps/files_external/lib/dropbox.php
+++ b/apps/files_external/lib/dropbox.php
@@ -33,7 +33,6 @@ class OC_Filestorage_Dropbox extends OC_Filestorage_Common {
 		$oauth = new Dropbox_OAuth_Curl($params['app_key'], $params['app_secret']);
 		$oauth->setToken($params['token'], $params['token_secret']);
 		$this->dropbox = new Dropbox_API($oauth, 'dropbox');
-		
 	}
 
 	private function getMetaData($path, $list = false) {
@@ -84,8 +83,8 @@ class OC_Filestorage_Dropbox extends OC_Filestorage_Common {
 			foreach ($contents as $file) {
 				$files[] = basename($file['path']);
 			}
-			OC_FakeDirStream::$dirs['dropbox'] = $files;
-			return opendir('fakedir://dropbox');
+			OC_FakeDirStream::$dirs['dropbox'.$path] = $files;
+			return opendir('fakedir://dropbox'.$path);
 		}
 		return false;
 	}
diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php
index fe60a06629abf246d232ecaa21d464e96207d6bb..41b560ae84e6f8a19eda60933095a4e6e151f73c 100644
--- a/apps/files_external/lib/google.php
+++ b/apps/files_external/lib/google.php
@@ -237,8 +237,8 @@ class OC_Filestorage_Google extends OC_Filestorage_Common {
 				$this->entries[$name] = $entry;
 			}
 		}
-		OC_FakeDirStream::$dirs['google'] = $files;
-		return opendir('fakedir://google');
+		OC_FakeDirStream::$dirs['google'.$path] = $files;
+		return opendir('fakedir://google'.$path);
 	}
 
 	public function stat($path) {
diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php
index fed1b834fa3a923e38b4427388e70b6055952ed3..4138fc2b399303fbf0037169ac53fe26f1c62f3e 100644
--- a/apps/files_sharing/sharedstorage.php
+++ b/apps/files_sharing/sharedstorage.php
@@ -81,8 +81,8 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
 					$files[] = basename($item['target']);
 				}
 			}
-			OC_FakeDirStream::$dirs['shared']=$files;
-			return opendir('fakedir://shared');
+			OC_FakeDirStream::$dirs['shared'.$path] = $files;
+			return opendir('fakedir://shared'.$path);
 		} else {
 			$source = $this->getSource($path);
 			if ($source) {
diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php
index bee6054333977f0a0858b8602f071d60e4a3fc96..fe48434d2cbedc53db6455f3fd611f1d205bae3c 100644
--- a/apps/files_versions/ajax/getVersions.php
+++ b/apps/files_versions/ajax/getVersions.php
@@ -5,7 +5,6 @@ require_once('apps/files_versions/versions.php');
 
 $userDirectory = "/".OCP\USER::getUser()."/files";
 $source = $_GET['source'];
-$source = strip_tags( $source );
 
 if( OCA_Versions\Storage::isversioned( $source ) ) {
 
@@ -14,9 +13,7 @@ if( OCA_Versions\Storage::isversioned( $source ) ) {
 	$versionsFormatted = array();
 	
 	foreach ( $versions AS $version ) {
-	
-		$versionsFormatted[] = OCP\Util::formatDate( $version );
-		
+		$versionsFormatted[] = OCP\Util::formatDate( doubleval($version) );
 	}
 
 	$versionsSorted = array_reverse( $versions );
diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php
index cb4726e8d0e735a4e3fc177d489a5e9abb11ffde..ca03de0472bb8b3b6bcfea008cf569211212bb8d 100644
--- a/apps/files_versions/history.php
+++ b/apps/files_versions/history.php
@@ -38,13 +38,13 @@ if ( isset( $_GET['path'] ) ) {
 			
 			$tmpl->assign( 'outcome_stat', 'success' );
 			
-			$tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OCP\Util::formatDate( $_GET['revert'] ) );
+			$tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) );
 			
 		} else {
 		
 			$tmpl->assign( 'outcome_stat', 'failure' );
 		
-			$tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( $_GET['revert'] ) );
+			$tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) );
 			
 		}
 		
diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js
index 82d569fa0f6fe7500355d207483a56759455e969..a090fde446e1f96f970154647f1c1b82a4e35df3 100644
--- a/apps/files_versions/js/versions.js
+++ b/apps/files_versions/js/versions.js
@@ -104,9 +104,9 @@ function createVersionsDropdown(filename, files) {
 	}
 	
 	function addVersion(revision ) {
-		name=formatDate(revision*1000);
+		name=formatDate(revision.version*1000);
 		var version=$('<option/>');
-		version.attr('value',revision);
+		version.attr('value',revision.version);
 		version.text(name);
 		
 // 		} else {
diff --git a/apps/files_versions/templates/history.php b/apps/files_versions/templates/history.php
index 13e104152b7cffcf0aa1e66446e229ab1a70d150..1b4425564212ebddec4e6f1ca82334b3159d8596 100644
--- a/apps/files_versions/templates/history.php
+++ b/apps/files_versions/templates/history.php
@@ -20,13 +20,11 @@ if( isset( $_['message'] ) ) {
 	echo('<p><em>Revert a file to a previous version by clicking on its revert button</em></p><br />');
 	
 	foreach ( $_['versions'] as $v ) {
-	
 		echo ' ';
-		echo OCP\Util::formatDate( $v['version'] );
+		echo OCP\Util::formatDate( doubleval($v['version']) );
 		echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php').'?path='.urlencode( $_['path'] ).'&revert='. $v['version'] .'" class="button">Revert</a><br /><br />';
 		if ( $v['cur'] ) { echo '  (<b>Current</b>)'; }
 		echo '<br /><br />';
-		
 	}
 
 }
diff --git a/lib/app.php b/lib/app.php
index a9feff1620ab2f17a688fefdb3c779e3d9ac25dd..61566ed7522c46d4b3325e50d164873b15adc590 100755
--- a/lib/app.php
+++ b/lib/app.php
@@ -36,6 +36,7 @@ class OC_App{
 	static private $appInfo = array();
 	static private $appTypes = array();
 	static private $loadedApps = array();
+	static private $checkedApps = array();
 
 	/**
 	 * @brief loads all apps
@@ -530,6 +531,10 @@ class OC_App{
 	 * check if the app need updating and update when needed
 	 */
 	public static function checkUpgrade($app) {
+		if (in_array($app, self::$checkedApps)) {
+			return;
+		}
+		self::$checkedApps[] = $app;
 		$versions = self::getAppVersions();
 		$currentVersion=OC_App::getAppVersion($app);
 		if ($currentVersion) {