Finished disconnect handling

Still need to fix the flow of the program, so that disconnects go
smoother.