Clean up (and fix) erc tracking logic.