Some initial fixes for windows compilation