core.c: Give new parent rather than old in case of "bad_parent" flag.