Fixed bug in type conversion for device id