Workaround mixed casting issue with macros