Fix BSD/OSX bug, where sockaddr.sa_len wasn't set
Fix OSX compilation warnings