Fixes for release builds on Windows