Fix for multiple materials.