Added disconnect and timeout. Fixes #31