Fix invalid reference to ty