Fixed a bug in the removeChildrenOfType() method.