Per my comment on `erase()`, here's where it goes wrong.

If it was just a global variable then it'd probably be okay.