diff --git a/mininet/node.py b/mininet/node.py
index 949e7678c0c87524b8a63b46fe91ee6a36bdfe3d..0e2051efcc03e9aa92c2478f60b4500b1c785157 100644
--- a/mininet/node.py
+++ b/mininet/node.py
@@ -653,8 +653,8 @@ def popen( self, *args, **kwargs ):
            args: Popen() args, single list, or string
            kwargs: Popen() keyword args"""
         # Tell mnexec to execute command in our cgroup
-        mncmd = [ 'mnexec', '-da', str( self.pid ),
-                  '-g', self.name ]
+        mncmd = [ 'mnexec', '-g', self.name,
+                  '-da', str( self.pid ) ]
         if self.sched == 'rt':
             mncmd += [ '-r', str( self.rtprio ) ]
         return Host.popen( self, *args, mncmd=mncmd, **kwargs )
diff --git a/util/m b/util/m
index 860eeb05f408e819816ebda0613cdb0a1c0b8a9d..f3b8ce55ce3ae92a9e170a52cddbf8201e41c404 100755
--- a/util/m
+++ b/util/m
@@ -40,5 +40,5 @@ if [ -d $rootdir -a -x $rootdir/bin/bash ]; then
     cmd="chroot $rootdir /bin/bash -c $cmd"
 fi
 
-cmd="exec sudo mnexec -a $pid $cg $cmd"
+cmd="exec sudo mnexec $cg -a $pid $cmd"
 eval $cmd