diff --git a/application/modules/opac/views/scripts/bib/bibview.phtml b/application/modules/opac/views/scripts/bib/bibview.phtml
index 61c98c02382f6222afcf34685698c1f0c0a05d17..b8f279e549ffa5c022f7cf65f37135a5df7380d9 100644
--- a/application/modules/opac/views/scripts/bib/bibview.phtml
+++ b/application/modules/opac/views/scripts/bib/bibview.phtml
@@ -1,15 +1,15 @@
 <?php 
 $this->openBoite($this->_("Rechercher un livre, un disque, une vidéo"));
-	 
+
 if(!$_SESSION["selection_bib"]["nb_notices"]) print($this->_("Le catalogue de cette bibliothèque n'est pas encore intégré au portail"));
 else
 {
 ?>
 
 
-<form id="recherche" style="text-align: left;" name="recherche" method="post" action="<?php echo $this->view(['controller'=>'recherche',
-'action'=>'simple',
-'geo_bib'=>$this->id_bib]); ?>">
+<form id="recherche" style="text-align: left;" name="recherche" method="post" action="<?php echo $this->url(['controller'=>'recherche',
+																																																						 'action'=>'simple',
+																																																						 'geo_bib'=>$this->id_bib]); ?>">
   <input type="field" style="width: 250px;" value="" name="expressionRecherche" id="expressionRecherche" />
   <input class="submit" type="submit" value="" name="button"/>
   <?php echo $this->_('La bibliothèque contient %s notices.', $_SESSION["selection_bib"]["nb_notices"]) ?>
diff --git a/library/startup.php b/library/startup.php
index 0f0a744cd8487d7af338e3668adb29e098977b55..261b1e2d7f0563e82a9877dd66ccd17785f1e611 100644
--- a/library/startup.php
+++ b/library/startup.php
@@ -254,7 +254,7 @@ function setupHTTPClient($cfg) {
 
 
 function setupMail($cfg) {
-	if ($cfg->mail->transport->smtp) {
+	if (isset($cfg->mail->transport->smtp)) {
 		ZendAfi_Mail::setDefaultTransport(new Zend_Mail_Transport_Smtp($cfg->mail->transport->smtp->host,
 																																	 $cfg->mail->transport->smtp->toArray()));
 		return;
diff --git a/tests/application/modules/opac/controllers/BibControllerTest.php b/tests/application/modules/opac/controllers/BibControllerTest.php
index ec17e3999095fc60a2f4c3d2a5cec8a9bc7473da..1860d47028e65c32d047da6d01905379e64927d1 100644
--- a/tests/application/modules/opac/controllers/BibControllerTest.php
+++ b/tests/application/modules/opac/controllers/BibControllerTest.php
@@ -239,9 +239,29 @@ class BibControllerMapViewTest extends BibControllerWithZoneTestCase {
 
 
 class BibControllerBibViewAnnecyTest extends BibControllerWithZoneTestCase {
+	protected $_mock_sql;
+
 	public function setUp() {
 		parent::setUp();
-		$this->dispatch('bib/bibview/id/4');
+
+		$this->_mock_sql = Storm_Test_ObjectWrapper::mock();
+		Zend_Registry::set('sql', $this->_mock_sql);
+
+		$this->_mock_sql
+			->whenCalled('fetchOne')
+			->answers('')
+
+			->whenCalled('fetchOne')
+			->with("select count(*) from exemplaires where id_bib='4'")
+			->answers(20);
+
+		$this->dispatch('bib/bibview/id/4', true);
+	}
+
+
+	/** @test */
+	public function formRechercheShouldLinkToCurrentBib() {
+		$this->assertXPath('//form[contains(@action, "/recherche/simple/id/4/geo_bib/4")]', $this->_response->getBody());
 	}