Fix the test script to check that errors contain no exceptions.
Add some missing cases to isPolymorphic.