fix service #name clashes in nested macros