Yiannis: Please share your reasons with us. I know that my approach is a "brute force quick fix", but until you manage to pinpoint the bug and find out why it crashes, i'm afraid there's no other way. I would have preferred to keep that code intact, but I fail to understand why it has to be that way.
Please tell me, why do we have only to delete the invalid nodes, apart from the aesthetical reasons? I want to know.