Minor fixes for disconnect, fixes #2