Fix a memory 'leak' on shutdown
Add disconnect count to diagnostics