Index: wp-includes/theme.php
===================================================================
--- wp-includes/theme.php	(revision 22544)
+++ wp-includes/theme.php	(working copy)
@@ -682,6 +682,9 @@
 	if ( count( $wp_theme_directories ) > 1 ) {
 		update_option( 'template_root', get_raw_theme_root( $template, true ) );
 		update_option( 'stylesheet_root', get_raw_theme_root( $stylesheet, true ) );
+	} else {
+		delete_option( 'template_root' );
+		delete_option( 'stylesheet_root' );
 	}
 
 	$new_name  = $new_theme->get('Name');
