Sanitise asset names after potentially failed %-based substitutions (#945).