Fix the TR fix in efd482c30ff80f

My fix had just patched over a contract violation in a different
function. This commit fixes the root of the problem.