Fixes type conversion for abstract base classes.