Index: classes.php
===================================================================
--- classes.php	(revision 3469)
+++ classes.php	(working copy)
@@ -74,6 +74,7 @@
 
 	// Parse a query string and set query type booleans.
 	function parse_query ($query) {
+		global $wpdb;
 		if ( !empty($query) || !isset($this->query) ) {
 			$this->init();
 			parse_str($query, $qv);
@@ -102,7 +103,13 @@
 			$this->is_single = true;
 			$this->is_attachment = true;
 		} elseif ('' != $qv['name']) {
-			$this->is_single = true;
+				if ($qv['name'] == $wpdb->get_var("SELECT post_name FROM $wpdb->posts WHERE post_name = '" . $qv['name'] . "' LIMIT 1")) {
+					$this->is_single = true;			
+				}
+				else {
+					$this->is_404 = true;
+					$this->is_single = false;
+				}
 		} elseif ( $qv['p'] ) {
 			$this->is_single = true;
 		} elseif (('' != $qv['hour']) && ('' != $qv['minute']) &&('' != $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day'])) {
@@ -189,13 +196,25 @@
 			}
 
 			if ('' != $qv['category_name']) {
-				$this->is_category = true;
+				if ($qv['category_name'] == $wpdb->get_var("SELECT category_nicename FROM $wpdb->categories WHERE category_nicename = '" . $qv['category_name'] . "' LIMIT 1")) {
+					$this->is_category = true;			
+				}
+				else {
+					$this->is_404 = true;
+					$this->is_category = false;
+				}
 			}
             
 			if ((empty($qv['author'])) || ($qv['author'] == '0')) {
 				$this->is_author = false;
 			} else {
-				$this->is_author = true;
+				if ($qv['author_name'] == $wpdb->get_var("SELECT user_nicename FROM $wpdb->users WHERE user_nicename = '" . $qv['user_nicename'] . "' LIMIT 1")) {
+					$this->is_author = true;			
+				}
+				else {
+					$this->is_404 = true;
+					$this->is_author = false;
+				}
 			}
 
 			if ('' != $qv['author_name']) {
