Fixes an NPE with material matching

Uses the deprecated id system as a fall back.