Fixed duplication of children in parent's collection during flushing. #379

Fixed duplication of children in parent's collection during flushing. #379

Fix indentation issues