Fixed error occurring when container is added in markup and its first child is a text node instead of element