Fix windows build and warnings.