Fix macro expansion corner cases

Behave like rpm in regard of macro borders