diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/RecordActionsTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/RecordActionsTest.php
index 1cc11b7e80b7955cec84836f8a81cd7e25700655..498d3b233d1c2b7787a8741334b30de9c9ce99e5 100644
--- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/RecordActionsTest.php
+++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/RecordActionsTest.php
@@ -145,6 +145,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase
         // Go to a record view
         $page = $this->gotoRecord();
         // Click to add tag
+        $this->snooze();
         $this->findCss($page, '.tag-record')->click();
         $this->snooze();
         // Lightbox login open?
diff --git a/themes/bootstrap3/js/common.js b/themes/bootstrap3/js/common.js
index 1d0accce7a69f2ef655afd11e8e0b5ea32389e9a..dabe9fd1b98559d89b634561a680ef1cc9f83fc7 100644
--- a/themes/bootstrap3/js/common.js
+++ b/themes/bootstrap3/js/common.js
@@ -72,6 +72,25 @@ function lessFacets(id) {
   $('#more-'+id).removeClass('hidden');
 }
 
+// Phone number validation
+function phoneNumberFormHandler(numID, regionCode) {
+  var phoneInput = document.getElementById(numID);
+  var number = phoneInput.value;
+  var valid = isPhoneNumberValid(number, regionCode);
+  if(valid != true) {
+    if(typeof valid === 'string') {
+      valid = VuFind.translate(valid);
+    } else {
+      valid = VuFind.translate('libphonenumber_invalid');
+    }
+    $(phoneInput).siblings('.help-block.with-errors').html(valid);
+    $(phoneInput).closest('.form-group').addClass('sms-error');
+  } else {
+    $(phoneInput).closest('.form-group').removeClass('sms-error');
+    $(phoneInput).siblings('.help-block.with-errors').html('');
+  }
+}
+
 // Lightbox
 /*
  * This function adds jQuery events to elements in the lightbox
@@ -102,25 +121,6 @@ function bulkActionSubmit($form) {
   return false;
 }
 
-// Phone number validation
-function phoneNumberFormHandler(numID, regionCode) {
-  var phoneInput = document.getElementById(numID);
-  var number = phoneInput.value;
-  var valid = isPhoneNumberValid(number, regionCode);
-  if(valid != true) {
-    if(typeof valid === 'string') {
-      valid = VuFind.translate(valid);
-    } else {
-      valid = VuFind.translate('libphonenumber_invalid');
-    }
-    $(phoneInput).siblings('.help-block.with-errors').html(valid);
-    $(phoneInput).closest('.form-group').addClass('sms-error');
-  } else {
-    $(phoneInput).closest('.form-group').removeClass('sms-error');
-    $(phoneInput).siblings('.help-block.with-errors').html('');
-  }
-}
-
 function registerLightboxEvents() {
   var modal = $("#modal");
   // New list
@@ -221,12 +221,12 @@ function ajaxLogin(form) {
           data: params,
           success: function(response) {
             if (response.status == 'OK') {
+              Lightbox.addCloseAction(refreshPageForLogin);
               // and we update the modal
               var params = deparam(Lightbox.lastURL);
               if (params['subaction'] == 'UserLogin') {
-                refreshPageForLogin();
+                Lightbox.close();
               } else {
-                Lightbox.addCloseAction(refreshPageForLogin);
                 Lightbox.getByUrl(
                   Lightbox.lastURL,
                   Lightbox.lastPOST,
@@ -333,6 +333,12 @@ function setupAutocomplete() {
       }
     );
   });
+  // Update autocomplete on type change
+  $('.searchForm_type').change(function() {
+    var $lookfor = $(this).closest('.searchForm').find('.searchForm_lookfor[name]');
+    var query = $lookfor.val();
+    $lookfor.focus().typeahead('val', '').typeahead('val', query);
+  });
 }
 
 $(document).ready(function() {
diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js
index 007aa4b1f736093e8c854c4667744e6fc39f81a0..3eb9e04dd566dc202105ea396a067bac3e7c1046 100644
--- a/themes/bootstrap3/js/record.js
+++ b/themes/bootstrap3/js/record.js
@@ -274,6 +274,8 @@ function setupRecordToolbar(target) {
 }
 
 function recordDocReady() {
+  registerTabEvents();
+
   $('.record-tabs .nav-tabs a').click(function (e) {
     if ($(this.parentNode).hasClass('active')) {
       return true;
diff --git a/themes/bootstrap3/templates/collection/view.phtml b/themes/bootstrap3/templates/collection/view.phtml
index 65f2d7883b48c334db191cc87949f1b5fb01f57d..b84d64f33de3b6cd145205503d57afbdfdb80086 100644
--- a/themes/bootstrap3/templates/collection/view.phtml
+++ b/themes/bootstrap3/templates/collection/view.phtml
@@ -95,4 +95,4 @@
     </div>
   <? endif; ?>
 </div>
-<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready( recordDocReady );', 'SET'); ?>
+<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET'); ?>
diff --git a/themes/bootstrap3/templates/record/view.phtml b/themes/bootstrap3/templates/record/view.phtml
index 42f398af26b17a9261e940a12b167befccc2b621..ad803f2b48a81ca652a842af1f92367b4b9e3550 100644
--- a/themes/bootstrap3/templates/record/view.phtml
+++ b/themes/bootstrap3/templates/record/view.phtml
@@ -89,4 +89,4 @@
     <? endforeach; ?>
   </div>
 </div>
-<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready( recordDocReady );', 'SET'); ?>
+<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET'); ?>