Fix for when parentNode is null.