Rework selftest in idea.c.