Windows: Fix bad cast leading to heap corruption