Improve tail call elimination to handle the switch statement.