Improve error message in InheritanceHandler.