Fixed some portable issues with WSAGetLastError and GetLastError. Fix to stack smash on configuration file load.