Several small fixes
Fixing disconnections