diff --git a/settings/js/log.js b/settings/js/log.js
index 2e20aba3aa4f8773147088f8379d7a4952c9bee3..d91c180a52b13801f540990e0a26754ae31e5f07 100644
--- a/settings/js/log.js
+++ b/settings/js/log.js
@@ -17,30 +17,27 @@ OC.Log={
 	levels:['Debug','Info','Warning','Error','Fatal'],
 	loaded:3,//are initially loaded
 	getMore:function(count){
-		if(!count){
-			count=10;
-		}
+		count = count || 10;
 		$.get(OC.filePath('settings','ajax','getlog.php'),{offset:OC.Log.loaded,count:count},function(result){
 			if(result.status=='success'){
 				OC.Log.addEntries(result.data);
 				$('html, body').animate({scrollTop: $(document).height()}, 800);
 				if(!result.remain){
-					$('#moreLog').css('display', 'none');
+					$('#moreLog').hide();
 				}
-				$('#lessLog').css('display', '');
+				$('#lessLog').show();
 			}
 		});
 	},
 	showLess:function(count){
 		count = count || 10;
-		$('#moreLog').css('display', '');
-		while(OC.Log.loaded > 3 && count){
-			$('#log tr').last().remove();
-			OC.Log.loaded -= 1;
-			count--;
-		}
+		//calculate remaining items - at least 3
+		OC.Log.loaded = Math.max(3,OC.Log.loaded-count);
+		$('#moreLog').hide();
+		// remove all non-remaining items
+		$('#log tr').slice(OC.Log.loaded).remove();
 		if(OC.Log.loaded <= 3)
-			$('#lessLog').css('display', 'none');
+			$('#lessLog').hide();
 	},
 	addEntries:function(entries){
 		for(var i=0;i<entries.length;i++){
@@ -68,6 +65,7 @@ OC.Log={
 }
 
 $(document).ready(function(){
+	$('#lessLog').hide(); // initially hide the less button
 	$('#moreLog').click(function(){
 		OC.Log.getMore();
 	})
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index bdf4e676c1c461834bfd81dfbb52e62d8699a312..9d7a5d9a4cf04243137e907b4353dd56ead9879c 100644
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -201,7 +201,7 @@ if (!$_['internetconnectionworking']) {
 		<?php endif;
 endfor;?>
 </select>
-	<table id='log'>
+	<table id="log">
 		<?php foreach ($_['entries'] as $entry): ?>
 		<tr>
 			<td>
@@ -220,8 +220,8 @@ endfor;?>
 		<?php endforeach;?>
 	</table>
 	<?php if ($_['entriesremain']): ?>
-	<input id='moreLog' type='button' value='<?php p($l->t('More'));?>...'>
-	<input id='lessLog' type='button' style='display:none' value='<?php p($l->t('Less'));?>...'>
+	<input id="moreLog" type="button" value="<?php p($l->t('More'));?>...">
+	<input id="lessLog" type="button" value="<?php p($l->t('Less'));?>...">
 	<?php endif; ?>
 
 </fieldset>