diff --git a/bin/mn b/bin/mn
index f96511cfb68c9a5f3195ae989f561fda30bdfec5..edd4d98423263ae1e8ca4955504ba83a180bac11 100755
--- a/bin/mn
+++ b/bin/mn
@@ -282,7 +282,7 @@ class MininetRunner( object ):
             CLI( mn, script=self.options.post )
 
         mn.stop()
-        
+
         elapsed = float( time.time() - start )
         info( 'completed in %0.3f seconds\n' % elapsed )
 
diff --git a/mininet/link.py b/mininet/link.py
index 2e6e171108708384fcaf5b883c2893a8fbba2c35..c7e5c72567e13e0269c1b347a3b46120b64bd7c7 100644
--- a/mininet/link.py
+++ b/mininet/link.py
@@ -97,7 +97,7 @@ def updateMAC( self ):
     def updateAddr( self ):
         """Return IP address and MAC address based on ifconfig.
         instead of updating ip and mac separately,
-        use one ifconfig call to do it simultaneously""""
+        use one ifconfig call to do it simultaneously"""
         ifconfig = self.ifconfig()
         ips = self._ipMatchRegex.findall( ifconfig )
         macs = self._macMatchRegex.findall( ifconfig )
@@ -118,7 +118,7 @@ def isUp( self, setUp=False ):
         if setUp:
             cmdOutput = self.ifconfig( 'up' )
             if cmdOutput:
-                error( "Error setting %s up: %s " % ( self.name, cmdOutput )
+                error( "Error setting %s up: %s " % ( self.name, cmdOutput ) )
                 return False
             else:
                 return True
diff --git a/mininet/net.py b/mininet/net.py
index 30feb8fd27fe529228c56ef912c7486fe3f3b82f..3b822f417542adffe25ba705cc5adca072221f15 100755
--- a/mininet/net.py
+++ b/mininet/net.py
@@ -303,21 +303,6 @@ def items( self ):
         "return (key,value) tuple list for every node in net"
         return zip( self.keys(), self.values() )
 
-    def generateMac( self ):
-        newMac = True
-        while True:
-            macList = [ 0x00 ]
-            for i in xrange ( 0, 5 ):
-                macList.append( random.randint( 0x00, 0xff ) )
-            mac = ':'.join( map(lambda x: "%02x" % x, macList ) )
-            for node in self.switches + self.hosts:
-                for intf in node.ports:
-                    if intf.mac == mac:
-                        newMac = False
-                        break
-            if newMac:
-                return mac
-
     def addLink( self, node1, node2, port1=None, port2=None,
                  cls=None, **params ):
         """"Add a link from node1 to node2
@@ -326,8 +311,8 @@ def addLink( self, node1, node2, port1=None, port2=None,
             port1: source port
             port2: dest port
             returns: link object"""
-        mac1 = self.generateMac()
-        mac2 = self.generateMac()
+        mac1 = macColonHex( random.randint( 1, (2**24 - 1) ) )
+        mac2 = macColonHex( random.randint( 1, (2**24 - 1) ) )
         defaults = { 'port1': port1,
                      'port2': port2,
                      'addr1': mac1,
diff --git a/mininet/node.py b/mininet/node.py
index 472e66a65ea50d0fd0a3406e1a28375344180c25..4eb27ade799cde27dac327a65e6634da610c745c 100644
--- a/mininet/node.py
+++ b/mininet/node.py
@@ -1193,7 +1193,6 @@ def start( self, controllers ):
         args.append( self.opts )
 
         logfile = '/tmp/ivs.%s.log' % self.name
-
         self.cmd( 'ifconfig lo up' )
         self.cmd( ' '.join(args) + ' >' + logfile + ' 2>&1 </dev/null &' )
 
diff --git a/mininet/util.py b/mininet/util.py
index 32160be14248df03e363eba63694226b5d204b37..1bd2c5d88d0464bbf56bc3b22996f78ffad67103 100644
--- a/mininet/util.py
+++ b/mininet/util.py
@@ -192,7 +192,7 @@ def moveIntfNoRetry( intf, dstNode, srcNode=None, printError=False ):
         cmdOutput = srcNode.cmd( cmd )
     else:
         cmdOutput = quietRun( cmd )
-    if output:
+    if cmdOutput:
         if printError:
             error( '*** Error: moveIntf: ' + intf +
                    ' not successfully moved to ' + dstNode.name + '\n' )
@@ -249,11 +249,29 @@ def _colonHex( val, bytecount ):
     chStr = ':'.join( pieces )
     return chStr
 
+def generateMac( self ):
+    newMac = True
+    while True:
+        macList = [ 0x00 ]
+        for i in xrange ( 0, 5 ):
+            macList.append( random.randint( 0x00, 0xff ) )
+        mac = ':'.join( map(lambda x: "%02x" % x, macList ) )
+        for node in self.switches + self.hosts:
+            for intf in node.ports:
+                if intf.mac == mac:
+                    newMac = False
+                    break
+        if newMac:
+            return mac
+
 def macColonHex( mac ):
     """Generate MAC colon-hex string from unsigned int.
        mac: MAC address as unsigned int
        returns: macStr MAC colon-hex string"""
-    return _colonHex( mac, 6 )
+    if mac < 2**24:
+        return 'A4:23:05:' + _colonHex( mac, 3 )
+    else:
+        return _colonHex( mac, 6 )
 
 def ipStr( ip ):
     """Generate IP address string from an unsigned int.