Clear connection state before stopping to avoid potential deadlocks
Merge branch 'master' into root
Fix mouse scrolling and remove unreachable code
Merge branch 'master' into root