Merged from origin/develop. Added support for on-demand macros.