Fixing the bugs on macros