Fix for #1770 (Error while deleting device attribute)