Fixed missing delete of materials