Fix warnings caused by 0 ancestors ref #6836