Fixed some macros doing unintended variable capture