Updated TypeFilteredIterator to use hasType.