Fix bug that would ignore material data