I believe this should fix #23 and the multiple connections.