Added checking of child objects in isSameTypeAs