This makes sure a child element is available before trying to modify it. Resolves issue #1474 (closed).