Added some ifdef for building on Windows.