Fixed crashing on Windows