Fixes to disconnect