Don't call connect twice.
Make connection optional and backwards compatible.
Merge pull request #3 from dpnova/master

Fix leaking of connections.