Minor fix to duplicate device name check