diff --git a/src/@dseries/subsasgn.m b/src/@dseries/subsasgn.m
index 2564e48283b9d03b57186c56a493509ad391fd3f..3bad7d0994f2673a69ba432b9b53a2959a28fb92 100644
--- a/src/@dseries/subsasgn.m
+++ b/src/@dseries/subsasgn.m
@@ -52,7 +52,7 @@ switch length(S)
                   error(['dseries::subsasgn: You cannot use implicit loops and regular expressions in the same rule!'])
               end
               if ~isempty(idArobase)
-                  elements = build_list_of_variables_with_loops(A.name, idArobase, element, {});
+                  elements = build_list_of_variables_with_loops({}, idArobase, element, {});
                   S(1).subs = replace_object_in_a_one_dimensional_cell_array(S(1).subs, elements(:), i);
               end
               if ~isempty(idBracket.open)
diff --git a/src/utilities/variables/build_list_of_variables_with_loops.m b/src/utilities/variables/build_list_of_variables_with_loops.m
index b85e7991b81ec401464fa3bae33bb31e29511b04..47562091a92a070fe2f82e4e3dd7fb2784ae4858 100644
--- a/src/utilities/variables/build_list_of_variables_with_loops.m
+++ b/src/utilities/variables/build_list_of_variables_with_loops.m
@@ -17,7 +17,7 @@ function list_of_variables = build_list_of_variables_with_loops(o_list_of_variab
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-checknames = isempty(o_list_of_variables);
+checknames = ~isempty(o_list_of_variables);
     
 NumberOfImplicitLoops = .5*length(idArobase);