Fixed the tail call optimization.