Added the cleaning of the device register.