Connect/disconnect buttons + some bugfixes.
Merge branch 'connect'