    return [self->normer normalizeResponse:[self processCommand:command]];
  }
  
-@@ -820,23 +836,23 @@
+ - (NSDictionary *)delete:(NSString *)_name {
++  if ([self->selectedFolder isEqualToString:_name]) {
++    [self unselect];
++  }
+   return [self _performCommand:@"delete" onFolder:_name];
+ }
+ - (NSDictionary *)create:(NSString *)_name {
+@@ -820,23 +839,23 @@
    return [self->normer normalizeResponse:[self processCommand:cmd]];
  }
  

   return [self->normer normalizeSearchResponse:[self processCommand:s]];
 }
 
@@ -1142,7 +1171,7 @@
   if ((_folder = [self _folder2ImapFolder:_folder]) == nil)
     return nil;
   

   return [self->normer normalizeStatusResponse:[self processCommand:cmd]];
 }
 
@@ -663,24 +678,28 @@
   if ((_newName = [self _folder2ImapFolder:_newName]) == nil)
     return nil;
   
