#779 Fix device deletion