Fixed some Windows build errors related to type conversions.