Fixed material deleting.