Debugging flattenChildren method