diff --git a/apps/calendar/templates/settings.php b/apps/calendar/templates/settings.php
index 44fbb230a4375e53026eefed48f0e67a32bfa4d4..19a1a543b4613e10f51492bcea357f08447ec9fe 100644
--- a/apps/calendar/templates/settings.php
+++ b/apps/calendar/templates/settings.php
@@ -11,8 +11,8 @@ OC_UTIL::addStyle('', 'jquery.multiselect');
 ?>
 <form id="calendar">
         <fieldset class="personalblock">
-                <label for="timezone"><strong><?php echo $l->t('Timezone');?></strong></label>
-		<select style="display: none;" id="timezone" name="timezone">
+		<table class="nostyle">
+			<tr><td><label for="timezone" class="bold"><?php echo $l->t('Timezone');?></label></td><td><select style="display: none;" id="timezone" name="timezone">
                 <?php
 		$continent = '';
 		foreach($_['timezones'] as $timezone):
@@ -27,33 +27,17 @@ OC_UTIL::addStyle('', 'jquery.multiselect');
 				echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>';
 			endif;
                 endforeach;?>
-                </select>&nbsp;&nbsp;
-		<label for="timeformat"><strong><?php echo $l->t('Timeformat');?></strong></label>
-		<select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat">
-			<option value="24" id="24h"><?php echo $l->t("24h"); ?></option>
-			<option value="ampm" id="ampm"><?php echo $l->t("12h"); ?></option>
-		</select><br />
-		<label for="firstdayofweek"><strong><?php echo $l->t('First day of the week');?></strong></label>
-		<select style="display: none;" id="firstdayofweek" name="firstdayofweek">
-		<?php
-		$weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
-		for($i = 0;$i <= 6;$i++){
-			echo '<option value="'.$i.'" id="select_'.$i.'">' . $l->t($weekdays[$i]) . '</option>';
-		}
-		?>
-		</select><br />
-		<label for="weekend"><strong><?php echo $l->t('Days of weekend');?></strong></label>
-		<select id="weekend" name="weekend[]" style="width: 50%;" multiple="multiple" title="<?php echo $l->t("Weekend"); ?>">
-		<?php
-		$weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
-		for($i = 0;$i <= 6;$i++){
-			echo '<option value="'.$weekdays[$i].'" id="selectweekend_' . $weekdays[$i] . '">' . $l->t($weekdays[$i]) . '</option>';
-		}
-		?>
-		</select><br />
-		<label for="duration"><strong><?php echo $l->t('Event duration');?></strong></label>
-		<input type="text" maxlength="3" size="3" style="width: 2em;" id="duration" name="duration" /> <?php echo $l->t("Minutes");?>
-		<br />
+                </select></td></tr>
+
+			<tr><td><label for="timeformat" class="bold"><?php echo $l->t('Timeformat');?></label></td><td>
+				<select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat">
+					<option value="24" id="24h"><?php echo $l->t("24h"); ?></option>
+					<option value="ampm" id="ampm"><?php echo $l->t("12h"); ?></option>
+				</select>
+			</td></tr>
+
+		</table>
+
 		<?php echo $l->t('Calendar CalDAV syncing address:');?> 
   		<?php echo OC_Helper::linkTo('apps/calendar', 'caldav.php', null, true); ?><br />
         </fieldset>
diff --git a/apps/contacts/ajax/addproperty.php b/apps/contacts/ajax/addproperty.php
index 0b218c6298f64489cd3e1fb4ad956eab50ecb65f..68c4f65fa5c74e5f5b434912e45f77539a036c84 100644
--- a/apps/contacts/ajax/addproperty.php
+++ b/apps/contacts/ajax/addproperty.php
@@ -53,16 +53,7 @@ $name = $_POST['name'];
 $value = $_POST['value'];
 $parameters = isset($_POST['parameteres'])?$_POST['parameters']:array();
 
-if(is_array($value)){
-	$value = OC_Contacts_VCard::escapeSemicolons($value);
-}
-$property = new Sabre_VObject_Property( $name, $value );
-$parameternames = array_keys($parameters);
-foreach($parameternames as $i){
-	$property->parameters[] = new Sabre_VObject_Parameter($i,$parameters[$i]);
-}
-
-$vcard->add($property);
+OC_Contacts_VCard::addVCardProperty($vcard, $name, $value, $parameters);
 
 $line = count($vcard->children) - 1;
 $checksum = md5($property->serialize());
diff --git a/apps/contacts/js/interface.js b/apps/contacts/js/interface.js
index 3ec84a3c8bac7df673219bfb89b3e712c973208a..47e9bb10b1f4f3218dbcc1f371df4a6647b43066 100644
--- a/apps/contacts/js/interface.js
+++ b/apps/contacts/js/interface.js
@@ -104,6 +104,8 @@ $(document).ready(function(){
 			if(jsondata.status == 'success'){
 				$('#rightcontent').data('id',jsondata.data.id);
 				$('#rightcontent').html(jsondata.data.page);
+				$('#leftcontent .active').removeClass('active');
+				$('#leftcontent ul').append('<li data-id="'+jsondata.data.id+'" class="active"><a href="index.php?id='+jsondata.data.id+'">'+jsondata.data.name+'</a></li>');
 			}
 			else{
 				alert(jsondata.data.message);
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php
index 1c9a8049f7310df62cc371ef2a00d343ca1fac74..bff2897384fd14ce6ca002877560666e4212b743 100644
--- a/apps/contacts/lib/vcard.php
+++ b/apps/contacts/lib/vcard.php
@@ -246,7 +246,7 @@ class OC_Contacts_VCard{
 	public static function escapeSemicolons($value){
 		foreach($value as &$i ){
 			$i = implode("\\\\;", explode(';', $i));
-		} unset($i);
+		}
 		return implode(';',$value);
 	}
 
@@ -272,6 +272,26 @@ class OC_Contacts_VCard{
 		return $array;
 	}
 
+	/**
+	 * @brief Add property to vcard object
+	 * @param object $vcard
+	 * @param object $name of property
+	 * @param object $value of property
+	 * @param object $paramerters of property
+	 */
+	public static function addVCardProperty($vcard, $name, $value, $parameters=array()){
+		if(is_array($value)){
+			$value = OC_Contacts_VCard::escapeSemicolons($value);
+		}
+		$property = new Sabre_VObject_Property( $name, $value );
+		$parameternames = array_keys($parameters);
+		foreach($parameternames as $i){
+			$property->parameters[] = new Sabre_VObject_Parameter($i,$parameters[$i]);
+		}
+
+		$vcard->add($property);
+	}
+
 	/**
 	 * @brief Data structure of vCard
 	 * @param object $property
diff --git a/apps/contacts/templates/part.addcardform.php b/apps/contacts/templates/part.addcardform.php
index e87c64507dce6f913e84be3af7b535d70a68ab24..c7d668fae58030584461f35c3c31c518279e9977 100644
--- a/apps/contacts/templates/part.addcardform.php
+++ b/apps/contacts/templates/part.addcardform.php
@@ -11,5 +11,41 @@
 	<?php endif; ?>
 	<label for="fn"><?php echo $l->t('Name'); ?></label>
 	<input type="text" name="fn" value=""><br>
+	<label for="ADR"><?php echo $l->t('Address'); ?></label>
+	<div id="contacts_addresspart">
+		<select id="ADR" name="parameters[ADR][TYPE]" size="1">
+			<option value="adr_work"><?php echo $l->t('Work'); ?></option>
+			<option value="adr_home" selected="selected"><?php echo $l->t('Home'); ?></option>
+		</select>
+		<p><label><?php echo $l->t('PO Box'); ?></label> <input type="text" name="value[ADR][0]" value=""></p>
+		<p><label><?php echo $l->t('Extended'); ?></label> <input type="text" name="value[ADR][1]" value=""></p>
+		<p><label><?php echo $l->t('Street'); ?></label> <input type="text" name="value[ADR][2]" value=""></p>
+		<p><label><?php echo $l->t('City'); ?></label> <input type="text" name="value[ADR][3]" value=""></p>
+		<p><label><?php echo $l->t('Region'); ?></label> <input type="text" name="value[ADR][4]" value=""></p>
+		<p><label><?php echo $l->t('Zipcode'); ?></label> <input type="text" name="value[ADR][5]" value=""></p>
+		<p><label><?php echo $l->t('Country'); ?></label> <input type="text" name="value[ADR][6]" value=""></p>
+	</div>
+	<label for="TEL"><?php echo $l->t('Telephone'); ?></label>
+	<div id="contacts_phonepart">
+		<select id="TEL" name="parameters[TEL][TYPE]" size="1">
+			<option value="home"><?php echo $l->t('Home'); ?></option>
+			<option value="cell" selected="selected"><?php echo $l->t('Mobile'); ?></option>
+			<option value="work"><?php echo $l->t('Work'); ?></option>
+			<option value="text"><?php echo $l->t('Text'); ?></option>
+			<option value="voice"><?php echo $l->t('Voice'); ?></option>
+			<option value="fax"><?php echo $l->t('Fax'); ?></option>
+			<option value="video"><?php echo $l->t('Video'); ?></option>
+			<option value="pager"><?php echo $l->t('Pager'); ?></option>
+		</select>
+		<input type="text" name="value[TEL]" value="">
+	</div>
+	<label for="EMAIL"><?php echo $l->t('Email'); ?></label>
+	<div id="contacts_email">
+		<input id="EMAIL" type="text" name="value[EMAIL]" value="">
+	</div>
+	<label for="ORG"><?php echo $l->t('Organization'); ?></label>
+	<div id="contacts_organisation">
+		<input id="ORG" type="text" name="value[ORG]" value="">
+	</div>
 	<input type="submit" name="submit" value="<?php echo $l->t('Create Contact'); ?>">
 </form>
diff --git a/apps/gallery/ajax/cover.php b/apps/gallery/ajax/cover.php
index 375905ec52056d215353bec939c78129bf89cb85..44d73028510010e92c83868e997aa65417c7dcbc 100644
--- a/apps/gallery/ajax/cover.php
+++ b/apps/gallery/ajax/cover.php
@@ -45,7 +45,7 @@ $box_size = 200;
 $album_name = $_GET['album'];
 $x = $_GET['x'];
 
-$stmt = OC_DB::prepare('SELECT file_path FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.uid_owner = ? AND album_name = ? AND *PREFIX*gallery_photos.album_id == *PREFIX*gallery_albums.album_id');
+$stmt = OC_DB::prepare('SELECT `file_path` FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.`uid_owner` = ? AND `album_name` = ? AND *PREFIX*gallery_photos.`album_id` == *PREFIX*gallery_albums.`album_id`');
 $result = $stmt->execute(array(OC_User::getUser(), $album_name));
 $x = min((int)($x/($box_size/$result->numRows())), $result->numRows()-1); // get image to display
 $result->seek($x); // never throws
diff --git a/apps/gallery/ajax/getAlbums.php b/apps/gallery/ajax/getAlbums.php
index 6b551ac49d519d879dc911ffdc48747e56297edd..2829dae81f3f0ad0bac54e4e83c1570e770a628e 100644
--- a/apps/gallery/ajax/getAlbums.php
+++ b/apps/gallery/ajax/getAlbums.php
@@ -7,12 +7,12 @@ if (!OC_User::IsLoggedIn()) {
 }
 
 $a = array();
-$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner = ?');
+$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ?');
 $result = $stmt->execute(array(OC_User::getUser()));
 
 while ($r = $result->fetchRow()) {
   $album_name = $r['album_name'];
-  $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE album_id = ?');
+  $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE `album_id` = ?');
   $tmp_res = $stmt->execute(array($r['album_id']));
   $a[] = array('name' => $album_name, 'numOfItems' => min($tmp_res->numRows(), 10));
 }
diff --git a/apps/gallery/ajax/getCovers.php b/apps/gallery/ajax/getCovers.php
index d56bf6fa4b7e5ce3bec3b9ae0f774989cf80086b..57737f2fdd65963577068b6ab1e9ce0766df4049 100644
--- a/apps/gallery/ajax/getCovers.php
+++ b/apps/gallery/ajax/getCovers.php
@@ -46,7 +46,7 @@ if( !OC_User::isLoggedIn()){
 $box_size = 200;
 $album_name= $_GET['album_name'];
 
-$stmt = OC_DB::prepare('SELECT file_path FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.uid_owner = ? AND album_name = ? AND *PREFIX*gallery_photos.album_id == *PREFIX*gallery_albums.album_id');
+$stmt = OC_DB::prepare('SELECT `file_path` FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.`uid_owner` = ? AND `album_name` = ? AND *PREFIX*gallery_photos.`album_id` = *PREFIX*gallery_albums.`album_id`');
 $result = $stmt->execute(array(OC_User::getUser(), $album_name));
 
 $numOfItems = min($result->numRows(),10);
diff --git a/apps/gallery/appinfo/info.xml b/apps/gallery/appinfo/info.xml
index 154b5fcf7ae719f2804871029fa4efe2eb5139ec..054ddb6f1398b544ce01bf1d1d0b296252aacd36 100644
--- a/apps/gallery/appinfo/info.xml
+++ b/apps/gallery/appinfo/info.xml
@@ -7,5 +7,4 @@
 	<author>Bartosz Przybylski</author>
 	<require>2</require>
 	<description></description>
-	<default_enable/>
-</info>
+</info>
\ No newline at end of file
diff --git a/apps/gallery/lib_scanner.php b/apps/gallery/lib_scanner.php
index fe14b68add1345ae50384b888395024629ce531d..5490c4a55adda1a77fc7996e250cce3dc1b6e8c8 100644
--- a/apps/gallery/lib_scanner.php
+++ b/apps/gallery/lib_scanner.php
@@ -28,21 +28,21 @@ class OC_GALLERY_SCANNER {
     }
     $current_album['imagesCount'] = count($current_album['images']);
     $albums[] = $current_album;
-    $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE "uid_owner" = ? AND "album_name" = ?');
+    $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ? AND `album_name` = ?');
     $result = $stmt->execute(array(OC_User::getUser(), $current_album['name']));
     if ($result->numRows() == 0 && count($current_album['images'])) {
-      $stmt = OC_DB::prepare('INSERT OR REPLACE INTO *PREFIX*gallery_albums ("uid_owner", "album_name") VALUES (?, ?)');
+      $stmt = OC_DB::prepare('REPLACE INTO *PREFIX*gallery_albums (`uid_owner`, `album_name`) VALUES (?, ?)');
       $stmt->execute(array(OC_User::getUser(), $current_album['name']));
     }
-    $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE "uid_owner" = ? AND "album_name" = ?');
+    $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ? AND `album_name` = ?');
     $result = $stmt->execute(array(OC_User::getUser(), $current_album['name']));
     $albumId = $result->fetchRow();
     $albumId = $albumId['album_id'];
     foreach ($current_album['images'] as $img) {
-      $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE "album_id" = ? AND "file_path" = ?');
+      $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE `album_id` = ? AND `file_path` = ?');
       $result = $stmt->execute(array($albumId, $img));
       if ($result->numRows() == 0) {
-        $stmt = OC_DB::prepare('INSERT OR REPLACE INTO *PREFIX*gallery_photos ("album_id", "file_path") VALUES (?, ?)');
+        $stmt = OC_DB::prepare('REPLACE INTO *PREFIX*gallery_photos (`album_id`, `file_path`) VALUES (?, ?)');
         $stmt->execute(array($albumId, $img));
       }
     }
diff --git a/apps/media/css/music.css b/apps/media/css/music.css
index c4db4e05855c6c9e6687222308f6d8ad79f58ee8..8575e6334a5d0fcfbc910ec07966e08987597c96 100644
--- a/apps/media/css/music.css
+++ b/apps/media/css/music.css
@@ -18,7 +18,7 @@ a.jp-mute,a.jp-unmute { left:24em; }
 div.jp-volume-bar { position:absolute; overflow:hidden; background:#eee; width:4em; height:0.4em; cursor:pointer; top:1.3em; left:27em; }
 div.jp-volume-bar-value { background:#ccc; width:0; height:0.4em; }
 
-#collection { padding-top:1em; position:relative; width:70em; float:left; }
+#collection { padding-top:1em; position:relative; width:100%; float:left; }
 #collection li.album,#collection li.song { margin-left:3em; }
 #leftcontent img.remove { display:none; float:right; cursor:pointer; }
 #leftcontent li:hover img.remove { display:inline; }
diff --git a/apps/remoteStorage/lib_remoteStorage.php b/apps/remoteStorage/lib_remoteStorage.php
index 259efb0da690b02a12c7b8c26803fa366f01a114..5677ab3c6e0149d4b90becb885b71cd696207f55 100644
--- a/apps/remoteStorage/lib_remoteStorage.php
+++ b/apps/remoteStorage/lib_remoteStorage.php
@@ -3,7 +3,7 @@
 class OC_remoteStorage {
 	public static function getValidTokens($ownCloudUser, $userAddress, $dataScope) {
 		$query=OC_DB::prepare("SELECT token,appUrl FROM *PREFIX*authtoken WHERE user=? AND userAddress=? AND dataScope=? LIMIT 100");
-		$result=$query->execute(array($user,$userAddress,$dataScope));
+		$result=$query->execute(array($ownCloudUser,$userAddress,$dataScope));
 		if( PEAR::isError($result)) {
 			$entry = 'DB Error: "'.$result->getMessage().'"<br />';
 			$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
diff --git a/core/css/styles.css b/core/css/styles.css
index 8f3093333184c1de3fdcfcd4a5533915e207db8f..84a024f95b91f5375d0786251588424c7915db29 100644
--- a/core/css/styles.css
+++ b/core/css/styles.css
@@ -15,9 +15,9 @@ body { background:#fefefe; font:normal .8em/1.6em "Lucida Grande", Arial, Verdan
 
 
 /* HEADERS */
-#body-user #header, #body-settings #header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; box-shadow:0 0 10px #000, inset 0 -2px 10px #222; }
+#body-user #header, #body-settings #header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; }
 #body-login #header { margin: -2em auto 0; text-align:center; height:10em;
- -moz-box-shadow:0 0 1em #000; -webkit-box-shadow:0 0 1em #000; box-shadow:0 0 1em #000;
+ -moz-box-shadow:0 0 1em rgba(0, 0, 0, .5); -webkit-box-shadow:0 0 1em rgba(0, 0, 0, .5); box-shadow:0 0 1em rgba(0, 0, 0, .5);
 background: #1d2d44; /* Old browsers */
 background: -moz-linear-gradient(top, #35537a 0%, #1d2d42 100%); /* FF3.6+ */
 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#35537a), color-stop(100%,#1d2d42)); /* Chrome,Safari4+ */
@@ -53,7 +53,7 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-
 #controls { width:100%; top:3.5em; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; }
 #controls .button { display:inline-block; }
 #content { margin:3.5em 0 0 12.5em; }
-#leftcontent, .leftcontent { position:absolute; top:6.4em; width:20em; background:#f8f8f8; height:100%; border-right:1px solid #ddd; }
+#leftcontent, .leftcontent { position:fixed; overflow: auto; top:6.4em; width:20em; background:#f8f8f8; border-right:1px solid #ddd; }
 #leftcontent li, .leftcontent li { padding:.3em .8em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; -webkit-transition:background-color 500ms; -moz-transition:background-color 500ms; -o-transition:background-color 500ms; transition:background-color 500ms; }
 #leftcontent li:hover, #leftcontent li:active, #leftcontent li.active, .leftcontent li:hover, .leftcontent li:active, .leftcontent li.active { background:#eee; }
 #rightcontent, .rightcontent { position:absolute; top:6.4em; left:33em; }
@@ -69,7 +69,7 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-
 #login form { width:22em; margin:2em auto 2em; padding:0; }
 #login form fieldset { background:0; border:0; margin-bottom:2em; padding:0; }
 #login form fieldset legend { font-weight:bold; }
-#login form label { margin:.8em .8em; color:#666; }
+#login form label { margin:.9em .8em .7em;; color:#666; }
 /* NEEDED FOR INFIELD LABELS */
 p.infield { position: relative; }
 label.infield { cursor: text !important; }
@@ -98,13 +98,14 @@ label.infield { cursor: text !important; }
 
 /* VARIOUS REUSABLE SELECTORS */
 .hidden { display:none; }
+.bold { font-weight: bold; }
 
 #notification { z-index:101; cursor:pointer; background-color:#fc4; border:0; padding:0 .7em .3em; display:none; position:fixed; left:50%; top:0; -moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; -moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; }
 
 .action, .selectedActions a, #logout { opacity:.3; -webkit-transition:opacity 500ms; -moz-transition:opacity 500ms; -o-transition:opacity 500ms; transition:opacity 500ms; }
 .action:hover, .selectedActions a:hover, #logout:hover { opacity:1; }
 
-table tr { -webkit-transition:background-color 500ms; -moz-transition:background-color 500ms; -o-transition:background-color 500ms; transition:background-color 500ms; }
+table:not(.nostyle) tr { -webkit-transition:background-color 500ms; -moz-transition:background-color 500ms; -o-transition:background-color 500ms; transition:background-color 500ms; }
 tbody tr:hover, tr:active { background-color:#f8f8f8; }
 
 #body-settings .personalblock, #body-settings .helpblock { padding:.5em 1em; margin:1em; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
diff --git a/core/js/js.js b/core/js/js.js
index 61a60c52485058dcd2ff8a31f3872b103de5a71d..9e814ca07298d23fae5a176997c84ab065d67d80 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -244,7 +244,36 @@ function object(o) {
 	return new F();
 }
 
+
+/**
+ * Fills height of window. (more precise than height: 100%;)
+ */
+function fillHeight(selector) {
+	var height = parseFloat($(window).height())-parseFloat(selector.css('top'));
+	selector.css('height', height + 'px');
+	if(selector.outerHeight() > selector.height())
+		selector.css('height', height-(selector.outerHeight()-selector.height()) + 'px');
+}
+
+/**
+ * Fills height and width of window. (more precise than height: 100%; or width: 100%;)
+ */
+function fillWindow(selector) {
+	fillHeight(selector);
+	var width = parseFloat($(window).width())-parseFloat(selector.css('left'));
+	selector.css('width', width + 'px');
+	if(selector.outerWidth() > selector.width())
+		selector.css('width', width-(selector.outerWidth()-selector.width()) + 'px');
+}
+
 $(document).ready(function(){
+
+	$(window).resize(function () {
+		fillHeight($('#leftcontent'));
+		fillWindow($('#rightcontent'));
+	});
+	$(window).trigger('resize');
+	
 	if(!SVGSupport()){//replace all svg images with png images for browser that dont support svg
 		replaceSVG();
 	}else{
diff --git a/core/templates/login.php b/core/templates/login.php
index aff0afac20389dc0a9cbeadcedc2c82df9b637f4..6c0a7a12227a64102ddf4af3c14e893cd9d9b0d3 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -1,5 +1,6 @@
 <form action="index.php" method="post">
 	<fieldset>
+		<?php if(!empty($_['redirect'])) { echo '<input type="hidden" name="redirect_url" value="'.$_['redirect'].'" />'; } ?>
 		<?php if($_['error']): ?>
 			<a href="./core/lostpassword/"><?php echo $l->t('Lost your password?'); ?></a>
 		<?php endif; ?>
diff --git a/index.php b/index.php
index fb8d1922dd475cadd3bf9ebd4230324f4816a646..2e55827a62a9144ba0a1942196dc9d4bf6991b8f 100644
--- a/index.php
+++ b/index.php
@@ -68,6 +68,9 @@ else {
 			OC_User::setUserId($_COOKIE['oc_username']);
 			OC_Util::redirectToDefaultPage();
 		}
+		else {
+			OC_User::unsetMagicInCookie();
+		}
 	}
 	
 	// Someone wants to log in :
@@ -90,5 +93,5 @@ else {
 		}
 	}
 
-	OC_Template::printGuestPage('', 'login', array('error' => $error ));
+	OC_Template::printGuestPage('', 'login', array('error' => $error, 'redirect' => isset($_REQUEST['redirect_url'])?$_REQUEST['redirect_url']:'' ));
 }
diff --git a/lib/helper.php b/lib/helper.php
index b6332b54aea47a596a05a7fc5b624ef0575c38fc..9c2b5fc33ce463dc925a0a12b2074165aad4d5a0 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -61,7 +61,7 @@ class OC_Helper {
 		}
 
 		if($redirect_url)
-			return $urlLinkTo.'?redirect_url='.$redirect_url;
+			return $urlLinkTo.'?redirect_url='.urlencode($_SERVER["REQUEST_URI"]);
 		else
 			return $urlLinkTo;
 
diff --git a/lib/util.php b/lib/util.php
index 5d03c56f18e6ed9bbc564f5dcd1749e6ecf098da..f8748e868c114ac02130ae99ebf49936fe9f3f62 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -321,7 +321,11 @@ class OC_Util {
 	* Redirect to the user default page
 	*/
 	public static function redirectToDefaultPage(){
-		header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', 'files/index.php'));
+		if(isset($_REQUEST['redirect_url'])) {
+			header( 'Location: '.$_REQUEST['redirect_url']);
+		} else {
+			header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', 'files/index.php'));
+		}
 		exit();
 	}
 }
diff --git a/settings/css/settings.css b/settings/css/settings.css
index 4b5bc06b21801b685d98364843e41905cbba488d..8d89cee6ec04777bead223cb5e88545cc5e3423b 100644
--- a/settings/css/settings.css
+++ b/settings/css/settings.css
@@ -9,11 +9,13 @@ input#identity { width:20em; }
 .msg.success{ color:#fff; background-color:#0f0; padding:3px; text-shadow:1px 1px #000; }
 .msg.error{ color:#fff; background-color:#f00; padding:3px; text-shadow:1px 1px #000; }
 
+table.nostyle label { margin-right: 2em; }
+table.nostyle td { padding: 0.2em 0; }
 
 /* USERS */
 form { display:inline; }
-table th { height:2em; color:#999; }
-table th, table td { border-bottom:1px solid #ddd; padding:0 .5em; padding-left:.8em; text-align:left; font-weight:normal; }
+table:not(.nostyle) th { height:2em; color:#999; }
+table:not(.nostyle) th, table:not(.nostyle) td { border-bottom:1px solid #ddd; padding:0 .5em; padding-left:.8em; text-align:left; font-weight:normal; }
 td.name, td.password { padding-left:.8em; }
 td.password>img, td.remove>img, td.quota>img { visibility:hidden; }
 td.password, td.quota { width:12em; cursor:pointer; }
@@ -24,8 +26,8 @@ tr:hover>td.password>span { margin:0; cursor:pointer; }
 tr:hover>td.remove>img, tr:hover>td.password>img, tr:hover>td.quota>img { visibility:visible; cursor:pointer; }
 tr:hover>td.remove>img { float:right; }
 li.selected { background-color:#ddd; }
-#content>table { margin-top:6.5em; }
-table { width:100%; }
+#content>table:not(.nostyle) { margin-top:6.5em; }
+table:not(.nostyle) { width:100%; }
 
 
 /* APPS */