fix count materials in index blocks