Add NameId if not present

@brockallen see any problem?