Index: wp-includes/class-wp-customize.php
===================================================================
--- wp-includes/class-wp-customize.php	(revision 20063)
+++ wp-includes/class-wp-customize.php	(working copy)
@@ -83,10 +83,6 @@
 		add_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
 		add_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
 
-		// @link: http://core.trac.wordpress.org/ticket/20027
-		add_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );
-		add_filter( 'pre_option_template', array( $this, 'get_template' ) );
-
 		// Handle custom theme roots.
 		if ( count( $wp_theme_directories ) > 1 ) {
 			add_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
Index: wp-includes/theme.php
===================================================================
--- wp-includes/theme.php	(revision 20063)
+++ wp-includes/theme.php	(working copy)
@@ -554,9 +554,9 @@
 
 	// If requesting the root for the current theme, consult options to avoid calling get_theme_roots()
 	if ( ! $skip_cache ) {
-		if ( get_option('stylesheet') == $stylesheet_or_template )
+		if ( get_stylesheet() == $stylesheet_or_template )
 			$theme_root = get_option('stylesheet_root');
-		elseif ( get_option('template') == $stylesheet_or_template )
+		elseif ( get_template() == $stylesheet_or_template )
 			$theme_root = get_option('template_root');
 	}
 
@@ -615,7 +615,7 @@
 	}
 
 	// Prevent theme mods to current theme being used on theme being previewed
-	add_filter( 'pre_option_theme_mods_' . get_option( 'stylesheet' ), '__return_empty_array' );
+	add_filter( 'pre_option_theme_mods_' . get_stylesheet(), '__return_empty_array' );
 
 	ob_start( 'preview_theme_ob_filter' );
 }
@@ -771,7 +771,7 @@
  * @return array Theme modifications.
  */
 function get_theme_mods() {
-	$theme_slug = get_option( 'stylesheet' );
+	$theme_slug = get_stylesheet();
 	if ( false === ( $mods = get_option( "theme_mods_$theme_slug" ) ) ) {
 		$theme_name = get_option( 'current_theme' );
 		if ( false === $theme_name )
@@ -825,7 +825,7 @@
 
 	$mods[ $name ] = $value;
 
-	$theme = get_option( 'stylesheet' );
+	$theme = get_stylesheet();
 	update_option( "theme_mods_$theme", $mods );
 }
 
@@ -851,7 +851,7 @@
 	if ( empty( $mods ) )
 		return remove_theme_mods();
 
-	$theme = get_option( 'stylesheet' );
+	$theme = get_stylesheet();
 	update_option( "theme_mods_$theme", $mods );
 }
 
@@ -861,7 +861,7 @@
  * @since 2.1.0
  */
 function remove_theme_mods() {
-	delete_option( 'theme_mods_' . get_option( 'stylesheet' ) );
+	delete_option( 'theme_mods_' . get_stylesheet() );
 
 	// Old style.
 	$theme_name = get_option( 'current_theme' );
@@ -1025,7 +1025,7 @@
 	$header_images = array();
 
 	// @todo caching
-	$headers = get_posts( array( 'post_type' => 'attachment', 'meta_key' => '_wp_attachment_is_custom_header', 'meta_value' => get_option('stylesheet'), 'orderby' => 'none', 'nopaging' => true ) );
+	$headers = get_posts( array( 'post_type' => 'attachment', 'meta_key' => '_wp_attachment_is_custom_header', 'meta_value' => get_stylesheet(), 'orderby' => 'none', 'nopaging' => true ) );
 
 	if ( empty( $headers ) )
 		return array();
Index: wp-admin/includes/class-wp-ms-themes-list-table.php
===================================================================
--- wp-admin/includes/class-wp-ms-themes-list-table.php	(revision 20063)
+++ wp-admin/includes/class-wp-ms-themes-list-table.php	(working copy)
@@ -287,7 +287,7 @@
 		if ( current_user_can('edit_themes') )
 			$actions['edit'] = '<a href="' . esc_url('theme-editor.php?theme=' .  $theme_key ) . '" title="' . esc_attr__('Open this theme in the Theme Editor') . '" class="edit">' . __('Edit') . '</a>';
 
-		if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $theme_key != get_option( 'stylesheet' ) && $theme_key != get_option( 'template' ) )
+		if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $theme_key != get_stylesheet() && $theme_key != get_template() )
 			$actions['delete'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=delete-selected&amp;checked[]=' . $theme_key . '&amp;theme_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-themes' ) ) . '" title="' . esc_attr__( 'Delete this theme' ) . '" class="delete">' . __( 'Delete' ) . '</a>';
 
 		$actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme_key, $theme, $context );
Index: wp-admin/includes/schema.php
===================================================================
--- wp-admin/includes/schema.php	(revision 20063)
+++ wp-admin/includes/schema.php	(working copy)
@@ -838,8 +838,8 @@
 		return $errors;
 
 	// set up site tables
-	$template = get_option( 'template' );
-	$stylesheet = get_option( 'stylesheet' );
+	$template = get_template();
+	$stylesheet = get_stylesheet();
 	$allowed_themes = array( $stylesheet => true );
 	if ( $template != $stylesheet )
 		$allowed_themes[ $template ] = true;
Index: wp-admin/includes/class-wp-themes-list-table.php
===================================================================
--- wp-admin/includes/class-wp-themes-list-table.php	(revision 20063)
+++ wp-admin/includes/class-wp-themes-list-table.php	(working copy)
@@ -41,7 +41,7 @@
 			}
 		}
 
-		unset( $themes[ get_option( 'stylesheet' ) ] );
+		unset( $themes[ get_stylesheet() ] );
 		WP_Theme::sort_by_name( $themes );
 
 		$per_page = 999;
@@ -126,12 +126,12 @@
 			$title = $theme->display('Name');
 			$version = $theme->display('Version');
 			$author = $theme->display('Author');
- 
+
 			$activate_link = wp_nonce_url( "themes.php?action=activate&amp;template=" . urlencode( $template ) . "&amp;stylesheet=" . urlencode( $stylesheet ), 'switch-theme_' . $template );
 			$preview_link = esc_url( add_query_arg(
 				array( 'preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true' ),
 				home_url( '/' ) ) );
- 
+
 			$actions = array();
 			$actions[] = '<a href="' . $activate_link . '" class="activatelink" title="'
 				. esc_attr( sprintf( __( 'Activate &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Activate' ) . '</a>';
@@ -141,9 +141,9 @@
 				$actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url( "themes.php?action=delete&amp;template=$stylesheet", 'delete-theme_' . $stylesheet )
 					. '" onclick="' . "return confirm( '" . esc_js( sprintf( __( "You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete." ), $title ) )
 					. "' );" . '">' . __( 'Delete' ) . '</a>';
- 
+
 			$actions = apply_filters( 'theme_action_links', $actions, $theme );
- 
+
 			$actions = implode ( ' | ', $actions );
 			?>
 			<a href="<?php echo $preview_link; ?>" class="thickbox thickbox-preview screenshot">
@@ -154,7 +154,7 @@
 			<h3><?php
 			/* translators: 1: theme title, 2: theme version, 3: theme author */
 			printf( __( '%1$s %2$s by %3$s' ), $title, $version, $author ) ; ?></h3>
- 
+
 			<span class='action-links'><?php echo $actions ?></span>
 			<span class="separator hide-if-no-js">| </span><a href="#" class="theme-detail hide-if-no-js" tabindex='4'><?php _e('Details') ?></a>
 			<div class="themedetaildiv hide-if-js">
Index: wp-admin/includes/template.php
===================================================================
--- wp-admin/includes/template.php	(revision 20063)
+++ wp-admin/includes/template.php	(working copy)
@@ -1485,7 +1485,7 @@
 
 function _media_states( $post ) {
 	$media_states = array();
-	$stylesheet = get_option('stylesheet');
+	$stylesheet = get_stylesheet();
 
 	if ( current_theme_supports( 'custom-header') ) {
 		$meta_header = get_post_meta($post->ID, '_wp_attachment_is_custom_header', true );
Index: wp-admin/theme-editor.php
===================================================================
--- wp-admin/theme-editor.php	(revision 20063)
+++ wp-admin/theme-editor.php	(working copy)
@@ -241,7 +241,7 @@
 	<?php } ?>
 
 		<div>
-		<?php if ( is_child_theme() && ! $is_child_theme && $themes[$theme]['Template'] == get_option('template') ) : ?>
+		<?php if ( is_child_theme() && ! $is_child_theme && $themes[$theme]['Template'] == get_template() ) : ?>
 			<p><?php if ( is_writeable( $file ) ) { ?><strong><?php _e( 'Caution:' ); ?></strong><?php } ?>
 			<?php _e( 'This is a file in your current parent theme.' ); ?></p>
 		<?php endif; ?>
Index: wp-admin/network/themes.php
===================================================================
--- wp-admin/network/themes.php	(revision 20063)
+++ wp-admin/network/themes.php	(working copy)
@@ -110,7 +110,7 @@
 
 			$themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
 
-			unset( $themes[ get_option( 'stylesheet' ) ], $themes[ get_option( 'template' ) ] );
+			unset( $themes[ get_stylesheet() ], $themes[ get_template() ] );
 
 			if ( empty( $themes ) ) {
 				wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
