Small improvements
Fixed memory leak issue with macros
Finally fixed all memory leaks (as fas I can see) with macros