In Gui.Application.doAutostart, this line:
elif(self.config.safeGetBoolean('GUI','loadKeys')):
should just be an if.
In Gui.Application .doAutostart, this line:
elif( self.config. safeGetBoolean( 'GUI',' loadKeys' )):
should just be an if.