Fixes to dMaterial handling.