Index: trunk/lib/MT/Template/Context.pm
===================================================================
--- trunk/lib/MT/Template/Context.pm (revision 3035)
+++ trunk/lib/MT/Template/Context.pm (revision 3082)
@@ -321,5 +321,5 @@
     # If no blog IDs specified, use the current blog
     if ( ! $blog_ids ) {
-        $terms->{$col} = $blog_id if $col eq 'blog_id';
+        $terms->{$col} = $blog_id if $blog_id && $col eq 'blog_id';
     } 
     # If exclude blogs, set the terms and the NOT arg for load
Index: trunk/lib/MT/Template/ContextHandlers.pm
===================================================================
--- trunk/lib/MT/Template/ContextHandlers.pm (revision 3062)
+++ trunk/lib/MT/Template/ContextHandlers.pm (revision 3082)
@@ -721,5 +721,10 @@
 sub _fltr_setvar {
     my ($str, $arg, $ctx) = @_;
-    $ctx->var($arg, $str);
+    if ( my $hash = $ctx->{__inside_set_hashvar} ) {
+        $hash->{$arg} = $str;
+    }
+    else {
+        $ctx->var($arg, $str);
+    }
     return '';
 }
@@ -10144,5 +10149,5 @@
     unless (ref $blog) {
         my $blog_id = $blog || $args->{offset_blog_id};
-        if ($blog) {
+        if ($blog_id) {
             $blog = MT->model('blog')->load($blog_id);
             return $ctx->error( MT->translate( 'Can\'t load blog #[_1].', $blog_id ) )
@@ -10155,5 +10160,5 @@
         my($y, $mo, $d, $h, $m, $s) = $ts =~ /(\d\d\d\d)[^\d]?(\d\d)[^\d]?(\d\d)[^\d]?(\d\d)[^\d]?(\d\d)[^\d]?(\d\d)/;
         $mo--;
-        my $server_offset = $blog->server_offset;
+        my $server_offset = ($blog && $blog->server_offset) || MT->config->TimeOffset;
         if ((localtime (timelocal ($s, $m, $h, $d, $mo, $y )))[8]) {
             $server_offset += 1;
@@ -10173,5 +10178,5 @@
         my $tz = 'Z';
         unless ($args->{utc}) {
-            my $so = $blog->server_offset;
+            my $so = ($blog && $blog->server_offset) || MT->config->TimeOffset;
             my $partial_hour_offset = 60 * abs($so - int($so));
             if ($format eq 'rfc822') {
@@ -15948,5 +15953,5 @@
     if (my $ext = $args->{file_ext}) {
         my @exts = split(',', $args->{file_ext});
-        if (!$assets) {
+        if ($assets) {
             push @filters, sub { my $a = $_[0]->file_ext; grep(m/$a/, @exts) };
         } else {
