Connections close cleanly

this closes #2