NB: This is the actual fix, avoiding circular reference that was causing the leak.
The other changes are incidental - ensuring the disconnect() clears links made by connect() for cleanliness.