Fixing tests and adding tests for disconnection