SOCKS proxy support added (fixes #1), bugfixes.