Fixed disconnect bugs