fixed bug where name wasn't saving if no primary name and self was primary [MJ-391]
duplicate name check with edge cases, zero deleting and test [MJ-391]