This fixes a bug in 'remove' event handling, which was introduced by eb1f9e30, as 'devnum' variable may not be initialized.