diff --git a/mininet/cli.py b/mininet/cli.py
index efb1808..e2c7099 100644
--- a/mininet/cli.py
+++ b/mininet/cli.py
@@ -35,11 +35,12 @@
 from mininet.log import info, output, error
 from mininet.term import makeTerms
 from mininet.util import quietRun, isShellBuiltin, dumpNodeConnections
+from mininet.node import CCNHost
 
 class CLI( Cmd ):
     "Simple command-line interface to talk to nodes."
 
-    prompt = 'mininet> '
+    prompt = 'miniccnx> '
 
     def __init__( self, mininet, stdin=sys.stdin, script=None ):
         self.mn = mininet
@@ -201,6 +202,16 @@
         for node in self.nodelist:
             output( '%s: %s\n' %
                     ( node.name, ','.join( node.intfNames() ) ) )
+            
+    def do_ccndump(self, _line):
+        "Dump FIB entries"
+        for node in self.nodelist:
+            if 'fib' in node.params:
+                output(node.name + ': ')
+                for name in node.params['fib']:
+                    output(str(name) + ' ')
+                output('\n')
+           
 
     def do_dump( self, _line ):
         "Dump node info."
diff --git a/mininet/conf_parser.py b/mininet/conf_parser.py
index 642b4b1..c9fe119 100644
--- a/mininet/conf_parser.py
+++ b/mininet/conf_parser.py
@@ -2,14 +2,15 @@
 
 class confCCNHost():
     
-    def __init__(self, name, app='', uri_tuples='', cpu=None):
+    def __init__(self, name, app='', uri_tuples='', cpu=None, cores=None):
         self.name = name
         self.app = app
         self.uri_tuples = uri_tuples
         self.cpu = cpu
+        self.cores = cores
         
     def __repr__(self):
-        return 'Name: ' + self.name + ' App: ' + self.app + ' URIS: ' + str(self.uri_tuples) + ' CPU:' + str(self.cpu)
+        return 'Name: ' + self.name + ' App: ' + self.app + ' URIS: ' + str(self.uri_tuples) + ' CPU:' + str(self.cpu) + ' Cores:' +str(self.cores)
 
 class confCCNLink():
     
@@ -41,13 +42,17 @@
         uris = rest
         uri_list=[]
         cpu = None
+        cores = None
+        
         for uri in uris:
             if re.match("cpu",uri):
                 cpu = float(uri.split('=')[1])
+            elif re.match("cores",uri):
+                cores = uri.split('=')[1]
             else:
                 uri_list.append((uri.split(',')[0],uri.split(',')[1]))
         
-        hosts.append(confCCNHost(name , app, uri_list,cpu))
+        hosts.append(confCCNHost(name , app, uri_list,cpu,cores))
     
     return hosts
 
@@ -68,14 +73,17 @@
         uris = rest
         uri_list=[]
         cpu = None
+        cores = None
         
         for uri in uris:
             if re.match("cpu",uri):
                 cpu = float(uri.split('=')[1])
+            elif re.match("cores",uri):
+                cores = uri.split('=')[1]    
             else:
                 uri_list.append((uri.split(',')[0],uri.split(',')[1]))
         
-        routers.append(confCCNHost(name=name , uri_tuples=uri_list, cpu=cpu))
+        routers.append(confCCNHost(name=name , uri_tuples=uri_list, cpu=cpu, cores=cores))
     
     return routers
 
@@ -104,7 +112,7 @@
             arg_name, arg_value = arg.split('=')
             key = arg_name
             value = arg_value
-            if key in ['loss','bw','jitter']:
+            if key in ['loss','bw','jitter','max_queue_size']:
                 value = int(value)
             
             link_dict[key] = value
diff --git a/mininet/link.py b/mininet/link.py
index 21e18ba..6c9dd7d 100644
--- a/mininet/link.py
+++ b/mininet/link.py
@@ -181,6 +181,7 @@
                 latency_ms=None, enable_ecn=False, enable_red=False ):
         "Return tc commands to set bandwidth"
 
+
         cmds, parent = [], ' root '
 
         if bw and ( bw < 0 or bw > 1000 ):
@@ -232,6 +233,7 @@
     def delayCmds( parent, delay=None, jitter=None,
                    loss=None, max_queue_size=None ):
         "Internal method: return tc commands for delay and loss"
+
         cmds = []
         if delay and delay < 0:
             error( 'Negative delay', delay, '\n' )
diff --git a/mininet/node.py b/mininet/node.py
index 99d2cc5..f8ec8c9 100644
--- a/mininet/node.py
+++ b/mininet/node.py
@@ -52,7 +52,7 @@
 
 from mininet.log import info, error, warn, debug
 from mininet.util import ( quietRun, errRun, errFail, moveIntf, isShellBuiltin,
-                           numCores, retry, mountCgroups )
+                           numCores, retry, mountCgroups, run )
 from mininet.moduledeps import moduleDeps, pathCheck, OVS_KMOD, OF_KMOD, TUN
 from mininet.link import Link, Intf, TCIntf
 
@@ -592,7 +592,8 @@
         "Return value of cgroup parameter"
         cmd = 'cgget -r %s.%s /%s' % (
             resource, param, self.name )
-        return int( quietRun( cmd ).split()[ -1 ] )
+        
+        return int(quietRun( cmd ).split()[ -1 ] )
 
     def cgroupDel( self ):
         "Clean up our cgroup"
@@ -724,7 +725,7 @@
         Host.__init__( self, name, **kwargs )
         if not CCNHost.inited:
             CCNHost.init()
-            
+           
         self.cmd("export CCN_LOCAL_SOCKNAME=/tmp/.sock.ccnx.{0}".format(self.name))
         self.cmd("ccndstart")
         self.peerList = {}
