Fixed bug when using spaces in device name