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