misc bug fixes for socks.py