Fix exception when generating unexpected relative object class error message