Changes for Windows compilation.

Tested on Windows 7