Fixed infinite loop with hugChildren in some corner cases.