Added support for profiles in macros