Properly parse device id