Fix build bug in automaterial.