Adding some helper scripts and small fixes for macros