Checks for valid device IDs.