When adding a component, if you switch components or stop adding a component, the component name (eg X19) increments when it shouldn't.
To fix this, on delete, if the component's name was the last one, decrement Circuit's nextName for that type (from the ComponentDesc).
The nextName also needs to be reset when the circuit is cleared.