fixed handling unexpectedly closed connections
Merge branch 'master' of github.com:shanet/asimov