core: Do some tail call elimination.