Add test_coverage make target
Fix socket.error handling

This closes #4