minor macros fixes
additional functions added