Fix isMaterial bug introduced in last change