Fixed DeviceTypeName function