Fixed material name replacement when %%material is used as a suffix
 * ToolMaterial stores display names with a trailing space, so it needs to be trimmed before replacement
 * Fixes comment in issue #7