Fix the MSVC build following r212382

Looks like the casts are needed there after all.