If there are more devices than nDevs, don't iterate over them as they may overwrite devices mapped below that with the mapping option.