Replace doubles before adding name. Handle triples.