Resolves 4.x problem (BROKEN due to sys/socket.h) and adds a few minor changes.
State Changed From-To: open->closed Committed, thanks!