Further improvements for object models.
Fix AliasingDomainSuite to work with the new TestObjectModel.
Fix castVariable to correctly recognize cast errors.