Fix unclosed stream
Fix unclosed socket
Update .gitignore