Made sure the device is killed when it throws an exception, and fixed the connection method
Made setDeviceDefaults public so it can be called when reconnecting the device