EMI: Fix casting issue with MSVC