fix windows build warnings and issues