Error reporting updated. Scope added for macros.