Fix named children replacement

When nesting child to named position, it is expected that existing name position will be replaced.
Also fix some missing `@return` PHPdocs.