Index: wp-includes/classes.php
===================================================================
--- wp-includes/classes.php	(revision 2523)
+++ wp-includes/classes.php	(working copy)
@@ -253,6 +253,11 @@
 			$q['posts_per_page'] = get_settings('posts_per_rss');
 			$q['what_to_show'] = 'posts';
 		}
+
+		if (isset($q['page'])) {
+			$q['page'] = trim($q['page'], '/');
+			$q['page'] = (int) $q['page'];
+		}
 	
 		$add_hours = intval(get_settings('gmt_offset'));
 		$add_minutes = intval(60 * (get_settings('gmt_offset') - $add_hours));
@@ -1123,7 +1128,8 @@
 					$post = 1;
 					$trackbackmatch = $match . $trackbackregex;
 					$trackbackquery = $trackbackindex . '?' . $query . '&tb=1';
-					$match = $match . '?([0-9]+)?/?$';
+					$match = rtrim($match, '/');
+					$match = $match . '(/[0-9]+)?/?$';
 					$query = $index . '?' . $query . '&page=' . $this->preg_index($num_toks + 1);
 				} else {
 					$match .= '?$';
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 2527)
+++ wp-includes/functions.php	(working copy)
@@ -879,9 +879,10 @@
 	$day = mysql2date('d.m.y', $post->post_date);
 	$currentmonth = mysql2date('m', $post->post_date);
 	$numpages = 1;
+	$page = get_query_var('page');
 	if (!$page)
 		$page = 1;
-	if (isset($p))
+	if (is_single() || is_page())
 		$more = 1;
 	$content = $post->post_content;
 	if (preg_match('/<!--nextpage-->/', $content)) {
