bug in hal_idt.cpp