NXP-10414: fix bug in root unregistration detection + more tests