Fixed a bug in the findRootElementName() method.