Fixed some build issues on Windows