diff --git a/docs/NEWS b/docs/NEWS
index 800f5bf4..8b432f3c 100644
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,8 @@
 Version 1.2 ()
 ------------------------------------------------------------------------
 
+    * Fix URL permalink lookup in some cases (garvinhicking, beta2)
+
     * Add admin backend templates for main area and the entry editor.
       Falls back to default PHP output if Smarty cannot be utilized.
       (garvinhicking)
diff --git a/index.php b/index.php
index 5e53d54d..7e3ccfb4 100644
--- a/index.php
+++ b/index.php
@@ -241,7 +241,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
             preg_match(PAT_PERMALINK, $uri, $matches) ) {
     $serendipity['view'] = 'entry';
 
-    $matches[1] = serendipity_searchPermalink($serendipity['permalinkStructure'], $uri, $matches[1], 'entry');
+    $matches[1] = serendipity_searchPermalink($serendipity['permalinkStructure'], $uri, (!empty($matches[2]) ? $matches[2] : $matches[1]), 'entry');
     serendipity_rememberComment();
 
     if (!empty($serendipity['POST']['submit']) && !isset($_REQUEST['serendipity']['csuccess'])) {
diff --git a/serendipity_config.inc.php b/serendipity_config.inc.php
index 663350ce..b27cf962 100644
--- a/serendipity_config.inc.php
+++ b/serendipity_config.inc.php
@@ -42,7 +42,7 @@ if (defined('USE_MEMSNAP')) {
 }
 
 // The version string
-$serendipity['version']         = '1.2-beta1';
+$serendipity['version']         = '1.2-beta2';
 
 // Setting this to 'false' will enable debugging output. All alpa/beta/cvs snapshot versions will emit debug information by default. To increase the debug level (to enable Smarty debugging), set this flag to 'debug'.
 $serendipity['production']      = (preg_match('@\-(alpha|beta|cvs)@', $serendipity['version']) ? false : true);