You seem to be on the money:
I found a problem when NPCs are created, the code sets id but doesn't set a name variable, so it fell back to the player name instead