Fix for rejected shares and some win32 work