fix windows build errors and warnings

closes #1888 closes #1884