Fix issues with DLL build on Windows