Fix material parsing