fix tail call optimization, exercised by trace