Fixed more bugs, everyhting now connects and disconnects smoothly