Make changes needed to compile on windows

cherry-picked for easy merging with new_rendering