MacroParser::expand trailing '%' bugfix

The problem appeared when the expanded text was ending with the '%'
character