diff --git a/bin/minindnedit b/bin/minindnedit
index fa5d071..4299590 100755
--- a/bin/minindnedit
+++ b/bin/minindnedit
@@ -207,14 +207,12 @@
             self.rootFrame = master
             n = Notebook(self.rootFrame)
             self.propFrame = Frame(n)
-            self.fibFrame = Frame(n)
 
             # NDN
             self.nfdFrame = NfdFrame(n, self.prefValues)
             self.nlsrFrame = NlsrFrame(n,self.prefValues)
 
             n.add(self.propFrame, text='Properties')
-            n.add(self.fibFrame, text='FIB Entries')
 
             n.add(self.nfdFrame, text=self.nfdFrame.frameLabel)
             n.add(self.nlsrFrame, text=self.nlsrFrame.frameLabel)
@@ -268,45 +266,12 @@
             else:
                 self.startEntry= Entry(self.propFrame)
 
-            ### TAB 2
-            # FIB Entries
-            self.fibEntries = 0
-            Label(self.fibFrame, text="FIB Entry:").grid(row=0, column=0, sticky=E)
-            self.fibButton = Button( self.fibFrame, text='Add', command=self.addEntry)
-            self.fibButton.grid(row=0, column=1)
-
-            self.fibFrame = VerticalScrolledTable(self.fibFrame, rows=0, columns=2, title='FIB Entries')
-            self.fibFrame.grid(row=1, column=0, sticky='nswe', columnspan=2)
-            self.fibTableFrame = self.fibFrame.interior
-            self.fibTableFrame.addRow(value=['Prefix','Next Hop'], readonly=True)
-
-            fibList = []
-            if 'fibEntries' in self.prefValues:
-                fibList = self.prefValues['fibEntries']
-            for fibEntr in fibList:
-                if isinstance( fibEntr, tuple ):
-                    self.fibTableFrame.addRow(value=fibEntr)
-                else:
-                    self.fibTableFrame.addRow(value=[fibEntr,''])
-
-        def addEntry( self ):
-            self.fibTableFrame.addRow()
-
         def apply(self):
-            fibEntries = []
-            for row in range(self.fibTableFrame.rows):
-                if (len(self.fibTableFrame.get(row, 0)) > 0 and row > 0):
-                    if(len(self.fibTableFrame.get(row, 1)) > 0):
-                        fibEntries.append((self.fibTableFrame.get(row, 0), self.fibTableFrame.get(row, 1)))
-                    else:
-                        fibEntries.append(self.fibTableFrame.get(row, 0))
-
             results = {'cpu': self.cpuEntry.get(),
                        'cache': self.cacheEntry.get(),
                        'mem': self.memEntry.get(),
                        'hostname':self.hostnameEntry.get(),
                        'startCommand':self.startEntry.get(),
-                       'fibEntries':fibEntries,
                        'nfd': self.nfdFrame.getValues(),
                        'nlsr': self.nlsrFrame.getValues()
             }
@@ -749,16 +714,6 @@
 
         self.template_file = old_template_file
 
-    def parseFibEntries ( self, fibEntries ):
-        "Parse FIB Entries for write"
-        result=''
-
-        for fibEntry in fibEntries:
-                entry = ','.join(map(str, fibEntry))
-                result += entry + ' '
-
-        return result
-
     def buildTemplate( self ): #COPIA Mini-NDN para criar Template
         "Generate template"
 
@@ -788,9 +743,6 @@
                 if 'mem' in hOpts:
                         mem=float(hOpts['mem'])/100
                         template.write('mem=' + repr(mem) + ' ')
-                if 'fibEntries' in hOpts:
-                        customFib = self.parseFibEntries(hOpts['fibEntries'])
-                        template.write(customFib)
                 if 'nlsr' in hOpts:
                         values = hOpts['nlsr']
 
@@ -834,10 +786,6 @@
             if 'cache' in rOpts:
                 template.write('cache=' + rOpts['cache'] + ' ')
                 hasOpt='True'
-            if 'fibEntries' in rOpts:
-                customFib = self.parseFibEntries(rOpts['fibEntries'])
-                template.write(customFib)
-                hasOpt='True'
             if hasOpt == 'False':
                 template.write('_')
 
@@ -1488,8 +1436,6 @@
                         widget[ 'text' ] = name
                     if len(hostBox.result['cache']) > 0:
                         newHostOpts['cache'] = hostBox.result['cache']
-                    if len(hostBox.result['fibEntries']) > 0:
-                        newHostOpts['fibEntries'] = hostBox.result['fibEntries']
 
                     newHostOpts['nlsr'] = hostBox.nlsrFrame.getValues()
                     newHostOpts['nfd'] = hostBox.nfdFrame.getValues()
@@ -1516,8 +1462,6 @@
                         widget[ 'text' ] = name
                     if len(hostBox.result['cache']) > 0:
                         newRouterOpts['cache'] = hostBox.result['cache']
-                    if len(hostBox.result['fibEntries']) > 0:
-                        newRouterOpts['fibEntries'] = hostBox.result['fibEntries']
                     self.routerOpts[name] = newRouterOpts
 
                     print 'New host details for ' + name + ' = ' + str(newRouterOpts)
diff --git a/ndn/ndn_host.py b/ndn/ndn_host.py
index 0bed247..15bf245 100644
--- a/ndn/ndn_host.py
+++ b/ndn/ndn_host.py
@@ -103,12 +103,11 @@
 
         self.peerList = {}
 
-    def config(self, fib=None, app=None, cache=None, **params):
+    def config(self, app=None, cache=None, **params):
 
         r = Node.config(self, **params)
 
-        self.setParam(r, 'app', fib=fib)   # why is this not app=app, to be investigated
-        self.setParam(r, 'fib', app=app)   # and this fib=fib
+        self.setParam(r, 'app', app=app)
         self.setParam(r, 'cache', cache=cache)
 
         return r
@@ -138,12 +137,11 @@
 
         self.peerList = {}
 
-    def config(self, fib=None, app=None, cpu=None, cores=None, cache=None, **params):
+    def config(self, app=None, cpu=None, cores=None, cache=None, **params):
 
         r = CPULimitedHost.config(self,cpu,cores, **params)
 
-        self.setParam(r, 'app', fib=fib)   #????? shoud it be app=app
-        self.setParam(r, 'fib', app=app)
+        self.setParam(r, 'app', app=app)
         self.setParam(r, 'cache', cache=cache)
 
         return r
