some tweaks to fix Windows compile.