Fix issues with elements with one or more children