Fixing a subtle bug in tail calls found by Rick.