macro expansion bugfixing