diff --git a/handlers/views_handler_filter.inc b/handlers/views_handler_filter.inc
index 541e5df..8c615de 100644
--- a/handlers/views_handler_filter.inc
+++ b/handlers/views_handler_filter.inc
@@ -582,6 +582,21 @@ class views_handler_filter extends views_handler {
   }
 
   /**
+   * Beside ensure the table, this function takes care about setting the group options right.
+   */
+  function ensure_my_table() {
+    // 0 is a special group, so take sure that all filter groups have a higher
+    // number then 0, so find the smallest.
+    $filters_groups = $this->view->display_handler->options['filter_groups']['groups'];
+    $lowest = min(array_keys($filters_groups));
+    $offset = $lowest + 1;
+    $this->options['group'] += $offset;
+
+    return parent::ensure_my_table();
+  }
+
+
+  /**
    * Add this filter to the query.
    *
    * Due to the nature of fapi, the value and the operator have an unintended
diff --git a/includes/view.inc b/includes/view.inc
index 602e90e..6f29962 100644
--- a/includes/view.inc
+++ b/includes/view.inc
@@ -839,10 +839,22 @@ class view extends views_db_object {
 
     // Set the filtering groups.
     if (!empty($this->filter)) {
+      // Setup the special group 0, which has always AND.
+      $this->query->set_group_operator('AND');
+      $this->query->set_where_group('AND', 0);
+
       $filter_groups = $this->display_handler->get_option('filter_groups');
+
+      // 0 is a special group, so take sure that all filter groups have a higher
+      // number then 0, so find the smallest.
+      $filters_groups = $this->view->display_handler->options['filter_groups']['groups'];
+      $lowest = min(array_keys($filters_groups));
+      $offset = $lowest + 1;
+
       if ($filter_groups) {
         $this->query->set_group_operator($filter_groups['operator']);
         foreach($filter_groups['groups'] as $id => $operator) {
+          $id += $offset;
           $this->query->set_where_group($operator, $id);
         }
       }
diff --git a/plugins/views_plugin_query_default.inc b/plugins/views_plugin_query_default.inc
index 082ff33..0ba71b8 100644
--- a/plugins/views_plugin_query_default.inc
+++ b/plugins/views_plugin_query_default.inc
@@ -1030,13 +1030,22 @@ class views_plugin_query_default extends views_plugin_query {
   /**
    * Construct the "WHERE" or "HAVING" part of the query.
    *
+   * As views has to wrap the conditions from arguments with AND a special group is wrapped around all conditions.
+   * This special group has the ID 0. There is other code in filters which takes sure that the group_id's
+   * are higher then 0.
+   *
    * @param $where
    *   'where' or 'having'.
    */
   function build_condition($where = 'where') {
     $has_condition = FALSE;
-    $main_group = $this->group_operator == 'OR' ? db_or() : db_and();
+    $has_arguments = FALSE;
+
+    $main_group = db_and();
+    $filter_group = $this->group_operator == 'OR' ? db_or() : db_and();
+
     foreach ($this->$where as $group => $info) {
+
       if (!empty($info['conditions'])) {
         $sub_group = $info['type'] == 'OR' ? db_or() : db_and();
         foreach ($info['conditions'] as $key => $clause) {
@@ -1055,9 +1064,23 @@ class views_plugin_query_default extends views_plugin_query {
             $sub_group->condition($clause['field'], $clause['value'], $clause['operator']);
           }
         }
-        $main_group->condition($sub_group);
+
+        // Add the item to the filter group
+        if ($group != 0) {
+          $filter_group->condition($sub_group);
+        }
+        else {
+          $has_arguments = TRUE;
+          $main_group->condition($sub_group);
+        }
       }
     }
+
+    $main_group->condition($filter_group);
+
+    if (!$has_arguments && $has_condition) {
+      return $filter_group;
+    }
     if ($has_condition) {
       return $main_group;
     }
