Fixed bug where an error was only thrown when a ParentNode has children