diff --git a/configs/Barreleye.py b/configs/Barreleye.py
index 7b74179..6403ed6 100644
--- a/configs/Barreleye.py
+++ b/configs/Barreleye.py
@@ -405,8 +405,6 @@
 		'PRODUCT_0'  : '<inventory_root>/system/bios',
 		'BOARD_3'    : '<inventory_root>/system/misc',
 		'PRODUCT_51' : '<inventory_root>/system/misc',
-		'PRODUCT_100': '<inventory_root>/system',
-		'CHASSIS_100': '<inventory_root>/system/chassis',
 		'BOARD_100'  : '<inventory_root>/system/chassis/io_board',
 		'BOARD_101'  : '<inventory_root>/system/chassis/sas_expander',
 		'BOARD_102'  : '<inventory_root>/system/chassis/hdd_backplane',
diff --git a/pychassisctl/chassis_control.py b/pychassisctl/chassis_control.py
old mode 100644
new mode 100755
index 376e0e9..56a2116
--- a/pychassisctl/chassis_control.py
+++ b/pychassisctl/chassis_control.py
@@ -19,197 +19,221 @@
 
 BOOTED = 100
 
-class ChassisControlObject(DbusProperties,DbusObjectManager):
-	def getUuid(self):
-		uuid = "";
-		try:
-			with open(MACHINE_ID) as f:
-				data = f.readline().rstrip('\n')
-				if (len(data) == 32):
-					uuid = data
-				else:
-					print "ERROR:  UUID is not formatted correctly: "+data
-		except:
-			print "ERROR: Unable to open uuid file: "+MACHINE_ID
-				
-		return uuid
- 
-	def __init__(self,bus,name):
-		self.dbus_objects = { }
-		DbusProperties.__init__(self)
-		DbusObjectManager.__init__(self)
-		dbus.service.Object.__init__(self,bus,name)
-		## load utilized objects
-		self.dbus_objects = {
-			'power_control' : { 
-				'bus_name' : 'org.openbmc.control.Power',
-				'object_name' : '/org/openbmc/control/power0',
-				'interface_name' : 'org.openbmc.control.Power'
-			},
-			'identify_led' : {
-				'bus_name' : 'org.openbmc.control.led',
-				'object_name' : '/org/openbmc/control/led/identify',
-				'interface_name' : 'org.openbmc.Led'
-			},
-			'watchdog' : {				
-				'bus_name' : 'org.openbmc.watchdog.Host',
-				'object_name' : '/org/openbmc/watchdog/host0',
-				'interface_name' : 'org.openbmc.Watchdog'
-			},
-			'host_services' : {
-				'bus_name' : 'org.openbmc.HostServices',
-				'object_name' : '/org/openbmc/HostServices',
-				'interface_name' : 'org.openbmc.HostServices'
-			},
-			'settings' : {
-				'bus_name' : 'org.openbmc.settings.Host',
-				'object_name' : '/org/openbmc/settings/host0',
-				'interface_name' : 'org.freedesktop.DBus.Properties'
-			},
-		}
 
-		#uuid
-		self.Set(DBUS_NAME,"uuid",self.getUuid())
-		self.Set(DBUS_NAME,"reboot",0)
+class ChassisControlObject(DbusProperties, DbusObjectManager):
+    def getUuid(self):
+        uuid = "";
+        try:
+            with open(MACHINE_ID) as f:
+                data = f.readline().rstrip('\n')
+                if (len(data) == 32):
+                    uuid = data
+                else:
+                    print "ERROR:  UUID is not formatted correctly: " + data
+        except:
+            print "ERROR: Unable to open uuid file: " + MACHINE_ID
 
-		bus.add_signal_receiver(self.power_button_signal_handler, 
-					dbus_interface = "org.openbmc.Button", signal_name = "Released", 
-					path="/org/openbmc/buttons/power0" )
-		bus.add_signal_receiver(self.reset_button_signal_handler, 
-					dbus_interface = "org.openbmc.Button", signal_name = "PressedLong", 
-					path="/org/openbmc/buttons/power0" )
-		bus.add_signal_receiver(self.softreset_button_signal_handler, 
-					dbus_interface = "org.openbmc.Button", signal_name = "Released", 
-					path="/org/openbmc/buttons/reset0" )
+        return uuid
 
-    		bus.add_signal_receiver(self.host_watchdog_signal_handler, 
-					dbus_interface = "org.openbmc.Watchdog", signal_name = "WatchdogError")
+    def __init__(self, bus, name):
+        self.dbus_objects = {}
+        DbusProperties.__init__(self)
+        DbusObjectManager.__init__(self)
+        dbus.service.Object.__init__(self, bus, name)
+        ## load utilized objects
+        self.dbus_objects = {
+            'power_control': {
+                'bus_name': 'org.openbmc.control.Power',
+                'object_name': '/org/openbmc/control/power0',
+                'interface_name': 'org.openbmc.control.Power'
+            },
+            'identify_led': {
+                'bus_name': 'org.openbmc.control.led',
+                'object_name': '/org/openbmc/control/led/identify',
+                'interface_name': 'org.openbmc.Led'
+            },
+            'watchdog': {
+                'bus_name': 'org.openbmc.watchdog.Host',
+                'object_name': '/org/openbmc/watchdog/host0',
+                'interface_name': 'org.openbmc.Watchdog'
+            },
+            'host_services': {
+                'bus_name': 'org.openbmc.HostServices',
+                'object_name': '/org/openbmc/HostServices',
+                'interface_name': 'org.openbmc.HostServices'
+            },
+            'settings': {
+                'bus_name': 'org.openbmc.settings.Host',
+                'object_name': '/org/openbmc/settings/host0',
+                'interface_name': 'org.freedesktop.DBus.Properties'
+            },
+            'host_control': {
+                'bus_name': 'org.openbmc.control.Host',
+                'object_name': '/org/openbmc/control/host0',
+                'interface_name': 'org.openbmc.control.Host'
+            },
+        }
 
-   		bus.add_signal_receiver(self.emergency_shutdown_signal_handler, 
-					dbus_interface = "org.openbmc.SensorThresholds", signal_name = "Emergency")
+        # uuid
+        self.Set(DBUS_NAME, "uuid", self.getUuid())
+        self.Set(DBUS_NAME, "reboot", 0)
 
-		bus.add_signal_receiver(self.SystemStateHandler,signal_name = "GotoSystemState")
-		self.InterfacesAdded(name,self.properties)
+        bus.add_signal_receiver(self.power_button_signal_handler,
+                                dbus_interface="org.openbmc.Button",
+                                signal_name="Released",
+                                path="/org/openbmc/buttons/power0")
+        bus.add_signal_receiver(self.reset_button_signal_handler,
+                                dbus_interface="org.openbmc.Button",
+                                signal_name="PressedLong",
+                                path="/org/openbmc/buttons/power0")
+        bus.add_signal_receiver(self.softreset_button_signal_handler,
+                                dbus_interface="org.openbmc.Button",
+                                signal_name="Released",
+                                path="/org/openbmc/buttons/reset0")
+
+        bus.add_signal_receiver(self.host_watchdog_signal_handler,
+                                dbus_interface="org.openbmc.Watchdog",
+                                signal_name="WatchdogError")
+
+        bus.add_signal_receiver(self.emergency_shutdown_signal_handler,
+                                dbus_interface="org.openbmc.SensorThresholds",
+                                signal_name="Emergency")
+
+        bus.add_signal_receiver(self.SystemStateHandler,
+                                signal_name="GotoSystemState")
+        self.InterfacesAdded(name, self.properties)
 
 
-	def getInterface(self,name):
-		o = self.dbus_objects[name]
-		obj = bus.get_object(o['bus_name'],o['object_name'],introspect=False)
-		return dbus.Interface(obj,o['interface_name'])
+    def getInterface(self, name):
+        o = self.dbus_objects[name]
+        obj = bus.get_object(o['bus_name'], o['object_name'], introspect=False)
+        return dbus.Interface(obj, o['interface_name'])
 
 
-	@dbus.service.method(DBUS_NAME,
-		in_signature='', out_signature='')
-	def setIdentify(self):
-		print "Turn on identify"
-		intf = self.getInterface('identify_led')
-		intf.setOn()	
-		return None
+    @dbus.service.method(DBUS_NAME,
+                         in_signature='', out_signature='')
+    def setIdentify(self):
+        print "Turn on identify"
+        intf = self.getInterface('identify_led')
+        intf.setOn()
+        return None
 
-	@dbus.service.method(DBUS_NAME,
-		in_signature='', out_signature='')
-	def clearIdentify(self):
-		print "Turn on identify"
-		intf = self.getInterface('identify_led')
-		intf.setOff()
-		return None
+    @dbus.service.method(DBUS_NAME,
+                         in_signature='', out_signature='')
+    def clearIdentify(self):
+        print "Turn on identify"
+        intf = self.getInterface('identify_led')
+        intf.setOff()
+        return None
 
-	@dbus.service.method(DBUS_NAME,
-		in_signature='', out_signature='')
-	def powerOn(self):
-		print "Turn on power and boot"
-		self.Set(DBUS_NAME,"reboot",0)
-		if (self.getPowerState()==0):
-			intf = self.getInterface('power_control')
-			intf.setPowerState(POWER_ON)
-			intfwatchdog = self.getInterface('watchdog')
-			#Start watchdog with 30s timeout per the OpenPower Host IPMI Spec
-			#Once the host starts booting, it'll reset and refresh the timer
-			intfwatchdog.set(30000)
-			intfwatchdog.start()
-		return None
+    @dbus.service.method(DBUS_NAME,
+                         in_signature='', out_signature='')
+    def powerOn(self):
+        print "Turn on power and boot"
+        self.Set(DBUS_NAME, "reboot", 0)
+        if (self.getPowerState() == 0):
+            intf = self.getInterface('power_control')
+            intf.setPowerState(POWER_ON)
 
-	@dbus.service.method(DBUS_NAME,
-		in_signature='', out_signature='')
-	def powerOff(self):
-		print "Turn off power"
-		intfwatchdog = self.getInterface('watchdog')
-		intfwatchdog.stop()
-		intf = self.getInterface('power_control')
-		intf.setPowerState(POWER_OFF)
-		return None
+            # Determine if debug_mode is set.  If it is then we don't
+            # want to start the watchdog since debug mode
+            intfcontrol = self.getInterface('host_control')
+            intfproperties = dbus.Interface(intfcontrol,
+                                            "org.freedesktop.DBus.Properties")
+            debug_mode = intfproperties.Get('org.openbmc.control.Host',
+                                            'debug_mode')
+            if(not debug_mode):
+                intfwatchdog = self.getInterface('watchdog')
+                # Start watchdog with 30s timeout per the OpenPower Host IPMI Spec
+                #Once the host starts booting, it'll reset and refresh the timer
+                intfwatchdog.set(30000)
+                intfwatchdog.start()
+            else:
+                print "Debug mode is on, no watchdog"
+        return None
 
-	@dbus.service.method(DBUS_NAME,
-		in_signature='', out_signature='')
-	def softPowerOff(self):
-		print "Soft off power"
-		intf = self.getInterface('host_services')
-		## host services will call power off when ready
-		intf.SoftPowerOff()
-		return None
+    @dbus.service.method(DBUS_NAME,
+                         in_signature='', out_signature='')
+    def powerOff(self):
+        print "Turn off power"
+        intfwatchdog = self.getInterface('watchdog')
+        intfwatchdog.stop()
+        intf = self.getInterface('power_control')
+        intf.setPowerState(POWER_OFF)
+        return None
 
-	@dbus.service.method(DBUS_NAME,
-		in_signature='', out_signature='')
-	def reboot(self):
-		print "Rebooting"
-		if self.getPowerState() == POWER_OFF:
-			self.powerOn();
-		else:
-			self.Set(DBUS_NAME,"reboot",1)
-			self.powerOff()
-		return None
+    @dbus.service.method(DBUS_NAME,
+                         in_signature='', out_signature='')
+    def softPowerOff(self):
+        print "Soft off power"
+        intf = self.getInterface('host_services')
+        ## host services will call power off when ready
+        intf.SoftPowerOff()
+        return None
 
-	@dbus.service.method(DBUS_NAME,
-		in_signature='', out_signature='')
-	def softReboot(self):
-		print "Soft Rebooting"
-		if self.getPowerState() == POWER_OFF:
-			self.powerOn();
-		else:
-			self.Set(DBUS_NAME,"reboot",1)
-			self.softPowerOff()
-		return None
+    @dbus.service.method(DBUS_NAME,
+                         in_signature='', out_signature='')
+    def reboot(self):
+        print "Rebooting"
+        if self.getPowerState() == POWER_OFF:
+            self.powerOn();
+        else:
+            self.Set(DBUS_NAME, "reboot", 1)
+            self.powerOff()
+        return None
 
-	@dbus.service.method(DBUS_NAME,
-		in_signature='', out_signature='i')
-	def getPowerState(self):
-		intf = self.getInterface('power_control')
-		return intf.getPowerState()
+    @dbus.service.method(DBUS_NAME,
+                         in_signature='', out_signature='')
+    def softReboot(self):
+        print "Soft Rebooting"
+        if self.getPowerState() == POWER_OFF:
+            self.powerOn();
+        else:
+            self.Set(DBUS_NAME, "reboot", 1)
+            self.softPowerOff()
+        return None
 
-	## Signal handler
+    @dbus.service.method(DBUS_NAME,
+                         in_signature='', out_signature='i')
+    def getPowerState(self):
+        intf = self.getInterface('power_control')
+        return intf.getPowerState()
 
-	def SystemStateHandler(self,state_name):
-		if (state_name == "HOST_POWERED_OFF" or state_name == "HOST_POWERED_ON"):
-			intf = self.getInterface('settings')
-			intf.Set("org.openbmc.settings.Host","system_state",state_name)
+    ## Signal handler
 
-		if (state_name == "HOST_POWERED_OFF" and self.Get(DBUS_NAME,"reboot")==1):
-			self.powerOn()
+    def SystemStateHandler(self, state_name):
+        if (
+                state_name == "HOST_POWERED_OFF" or state_name == "HOST_POWERED_ON"):
+            intf = self.getInterface('settings')
+            intf.Set("org.openbmc.settings.Host", "system_state", state_name)
 
-	def power_button_signal_handler(self):
-		# toggle power
-		state = self.getPowerState()
-		if state == POWER_OFF:
-			self.powerOn()
-		elif state == POWER_ON:
-			self.powerOff();
+        if (state_name == "HOST_POWERED_OFF" and self.Get(DBUS_NAME,
+                                                          "reboot") == 1):
+            self.powerOn()
 
-	def reset_button_signal_handler(self):
-		self.reboot();
+    def power_button_signal_handler(self):
+        # toggle power
+        state = self.getPowerState()
+        if state == POWER_OFF:
+            self.powerOn()
+        elif state == POWER_ON:
+            self.powerOff();
 
-	def softreset_button_signal_handler(self):
-		self.softReboot();
-		
-	def host_watchdog_signal_handler(self):
-		print "Watchdog Error, Hard Rebooting"
-		self.Set(DBUS_NAME,"reboot",1)
-		self.powerOff()
+    def reset_button_signal_handler(self):
+        self.reboot();
 
-	def emergency_shutdown_signal_handler(self):
-		print "Emergency Shutdown!"
-		self.powerOff()
-		
-		
+    def softreset_button_signal_handler(self):
+        self.softReboot();
+
+    def host_watchdog_signal_handler(self):
+        print "Watchdog Error, Hard Rebooting"
+        self.Set(DBUS_NAME, "reboot", 1)
+        self.powerOff()
+
+    def emergency_shutdown_signal_handler(self):
+        print "Emergency Shutdown!"
+        self.powerOff()
+
 
 if __name__ == '__main__':
     dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -218,7 +242,7 @@
     name = dbus.service.BusName(DBUS_NAME, bus)
     obj = ChassisControlObject(bus, OBJ_NAME)
     mainloop = gobject.MainLoop()
-    
+
     print "Running ChassisControlService"
     mainloop.run()
 
diff --git a/pyhwmon/hwmon.py b/pyhwmon/hwmon.py
index e5dc19a..bb363dc 100644
--- a/pyhwmon/hwmon.py
+++ b/pyhwmon/hwmon.py
@@ -65,6 +65,7 @@
 				self.writeAttribute(attribute,rtn[1])
 		except:
 			print "HWMON: Attibute no longer exists: "+attribute
+			self.sensors.pop(objpath,None)
 			return False
 
 
