Disable reconnection if disconnecting
Add test for cobe and improve testability