fix several bugs in ICD