diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php
index bda22ee3a030cc154250c56531ecc2eb25a5cbe1..769a40b359f4f7249c9fcc44353de603f66cdd63 100644
--- a/apps/files_encryption/lib/session.php
+++ b/apps/files_encryption/lib/session.php
@@ -70,9 +70,11 @@ class Session {
 	 */
 	public function setLegacyKey( $legacyKey ) {
 	
-		$_SESSION['legacyKey'] = $legacyKey;
+		if ( $_SESSION['legacyKey'] = $legacyKey ) {
 		
-		return true;
+			return true;
+			
+		}
 		
 	}
 	
diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php
index 4102a681d7f4d86d8f0d2bb6873bed7e1688343e..d4b993b4c0638a7a6596c56cfc5edd8fd7955814 100644
--- a/apps/files_encryption/lib/stream.php
+++ b/apps/files_encryption/lib/stream.php
@@ -347,7 +347,7 @@ class Stream {
 // 		
 // 		// Make sure we always start on a block start
 		if ( 0 != ( $pointer % 8192 ) ) { 
-		// if the current positoin of 
+		// if the current position of 
 		// file indicator is not aligned to a 8192 byte block, fix it 
 		// so that it is