Fixed device-unregistration if it is removed from registration.