Add minor changes.
Add various fixings for windows.
Add a few minor fixings for using sockets on windows.