[minor] Close open connections. Fixes #178

This seems to fix the issue explained in #178