Fixes for Windows support