Backport casting fix for MSVC compilation from zyre