Build system fixes for Windows